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;
      }
SWIGINTERN Xapian::docid Xapian_PostingIterator_get_docid(Xapian::PostingIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_PostingIterator_next(Xapian::PostingIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &other){
          return (*self) == other;
      }
SWIGINTERN std::string Xapian_TermIterator_get_term(Xapian::TermIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_TermIterator_next(Xapian::TermIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &other){
          return (*self) == other;
      }
SWIGINTERN std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &other){
          return (*self) == other;
      }
SWIGINTERN 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]);
      }
SWIGINTERN Xapian::docid Xapian_MSetIterator_get_docid(Xapian::MSetIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_MSetIterator_next(Xapian::MSetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_MSetIterator_prev(Xapian::MSetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &other){
          return (*self) == other;
      }
SWIGINTERN bool Xapian_ESet_is_empty(Xapian::ESet const *self){ return self->empty(); }
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;
      }
SWIGINTERN bool Xapian_RSet_is_empty(Xapian::RSet const *self){ return self->empty(); }
SWIGINTERN std::pair<Xapian::TermIterator,Xapian::TermIterator > Xapian_Enquire_get_matching_terms(Xapian::Enquire const *self,Xapian::MSetIterator const &hit){
          return make_pair(self->get_matching_terms_begin(hit),
                       self->get_matching_terms_end(hit));
      }
SWIGINTERN Xapian::Query *new_Xapian_Query__SWIG_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);
          }

/* -------- 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 int le_swig__p_Xapian__ESet=0; /* handle for ESet */
static int le_swig__p_double=0; /* handle for _p_double */
static int le_swig__p_Xapian__Enquire=0; /* handle for Enquire */
static int le_swig__p_Xapian__BoolWeight=0; /* handle for BoolWeight */
static int le_swig__p_Xapian__TradWeight=0; /* handle for TradWeight */
static int le_swig__p_Xapian__QueryParser=0; /* handle for QueryParser */
static int le_swig__p_Xapian__MSet=0; /* handle for MSet */
static int le_swig__p_Xapian__Stopper=0; /* handle for Stopper */
static int le_swig__p_time_t=0; /* handle for _p_time_t */
static int le_swig__p_Xapian__SimpleStopper=0; /* handle for SimpleStopper */
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 Query */
static int le_swig__p_Xapian__Database=0; /* handle for Database */
static int le_swig__p_Xapian__WritableDatabase=0; /* handle for WritableDatabase */
static int le_swig__p_Xapian__Document=0; /* handle for Document */
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 Stem */
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 Weight */
static int le_swig__p_Xapian__MSetIterator=0; /* handle for MSetIterator */
static int le_swig__p_Xapian__ValueIterator=0; /* handle for ValueIterator */
static int le_swig__p_Xapian__TermIterator=0; /* handle for TermIterator */
static int le_swig__p_Xapian__PostingIterator=0; /* handle for PostingIterator */
static int le_swig__p_Xapian__PositionIterator=0; /* handle for PositionIterator */
static int le_swig__p_Xapian__ESetIterator=0; /* handle for ESetIterator */
static int le_swig__p_Xapian__RSet=0; /* handle for RSet */
static int le_swig__p_Xapian__BM25Weight=0; /* handle for BM25Weight */
/* end vdecl subsection */
/* wrapper section */
ZEND_NAMED_FUNCTION(_wrap_version_string) {
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (char *)Xapian::version_string();
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value,result, 1);
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


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


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


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


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator__SWIG_0) {
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator__SWIG_1) {
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_PositionIterator. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator((Xapian::PositionIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_PositionIterator__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_PositionIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_PositionIterator'";
  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_PositionIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::PositionIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__PositionIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::PositionIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PositionIterator_get_termpos) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_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_PositionIterator_next) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_next. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PositionIterator_equals) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of PositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PositionIterator_skip_to) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_skip_to. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termpos) Z_LVAL_PP(args[1]);
    /*@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_PositionIterator_get_description) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator__SWIG_0) {
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator__SWIG_1) {
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_PostingIterator. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator((Xapian::PostingIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_PostingIterator__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_PostingIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_PostingIterator'";
  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_PostingIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::PostingIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__PostingIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::PostingIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PostingIterator_get_docid) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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_PostingIterator_next) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_next. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PostingIterator_equals) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of PostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_PostingIterator_skip_to) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_skip_to. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_PostingIterator_get_doclength) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::doclength result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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_PostingIterator_get_wdf) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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_PostingIterator_positionlist_begin) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_positionlist_end) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_get_description) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator__SWIG_0) {
  Xapian::TermIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator__SWIG_1) {
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_TermIterator. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator((Xapian::TermIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_TermIterator__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_TermIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_TermIterator'";
  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_TermIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::TermIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__TermIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::TermIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TermIterator_get_term) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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_TermIterator_next) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_next. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TermIterator_equals) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__TermIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TermIterator_skip_to) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_skip_to. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TermIterator_get_wdf) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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_TermIterator_get_termfreq) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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_TermIterator_positionlist_begin) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_positionlist_end) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_get_description) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator__SWIG_0) {
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator__SWIG_1) {
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ValueIterator. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator((Xapian::ValueIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_ValueIterator__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_ValueIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ValueIterator'";
  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_ValueIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ValueIterator_get_value) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_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_ValueIterator_next) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_next. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ValueIterator_equals) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ValueIterator_get_valueno) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::valueno result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_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_ValueIterator_get_description) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document__SWIG_0) {
  Xapian::Document *result = 0 ;
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document__SWIG_1) {
  Xapian::Document *arg1 = 0 ;
  Xapian::Document *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::Document *)new Xapian::Document((Xapian::Document const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_Document__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_Document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Document'";
  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_Document(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Document *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Document TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Document resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_get_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@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_Document_add_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_remove_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@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_Document_clear_values) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_clear_values. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_values();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_get_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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_Document_set_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_set_data. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_add_posting__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (Xapian::termcount) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_add_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_add_posting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          return _wrap_Document_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_Document_add_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_add_posting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_term__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_add_term__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_add_term) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        return _wrap_Document_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_Document_add_term__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_add_term'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_term_nopos__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term_nopos. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
    /*@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_Document_add_term_nopos__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term_nopos. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->add_term_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_Document_add_term_nopos) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        return _wrap_Document_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_Document_add_term_nopos__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_add_term_nopos'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_posting__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (Xapian::termcount) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_remove_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_remove_posting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          return _wrap_Document_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_Document_remove_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_remove_posting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_term) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_clear_terms) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_clear_terms. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_terms();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Document_termlist_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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_Document_termlist_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_termlist_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_values_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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_Document_values_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_values_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_get_description) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet__SWIG_0) {
  Xapian::MSet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet__SWIG_1) {
  Xapian::MSet *arg1 = 0 ;
  Xapian::MSet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_MSet. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet((Xapian::MSet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_MSet__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_MSet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_MSet'";
  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_MSet(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MSet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MSet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MSet resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSet_fetch__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2,*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSet_fetch__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSet_fetch__SWIG_2) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSet_fetch) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      return _wrap_MSet_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_MSet_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_MSet_fetch__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MSet_fetch'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_convert_to_percent__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight arg2 ;
  Xapian::percent result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
    /*@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_MSet_convert_to_percent__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::percent result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSet_convert_to_percent) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        return _wrap_MSet_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_MSet_convert_to_percent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MSet_convert_to_percent'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_termfreq) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::doccount result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_termfreq. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    arg2 = std::string(Z_STRVAL_PP(args[1]),Z_STRLEN_PP(args[1]));
  }
  {
    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_MSet_get_termweight) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_termweight. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    arg2 = std::string(Z_STRVAL_PP(args[1]),Z_STRLEN_PP(args[1]));
  }
  {
    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_MSet_get_firstitem) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_get_matches_lower_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_get_matches_estimated) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_get_matches_upper_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_get_max_possible) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_get_max_attained) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_size) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_is_empty) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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_MSet_begin) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_end) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_back) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_hit) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::MSetIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_document_percentage) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  int result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@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_MSet_get_document) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::Document result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_docid) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@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_MSet_get_document_id) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@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_MSet_get_description) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator__SWIG_0) {
  Xapian::MSetIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator__SWIG_1) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_MSetIterator. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator((Xapian::MSetIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_MSetIterator__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_MSetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_MSetIterator'";
  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_MSetIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MSetIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MSetIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MSetIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSetIterator_get_docid) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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_MSetIterator_next) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_next. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSetIterator_prev) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_prev. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSetIterator_equals) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_MSetIterator_get_document) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::Document result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_rank) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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_MSetIterator_get_weight) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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_MSetIterator_get_collapse_count) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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_MSetIterator_get_percent) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::percent result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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_MSetIterator_get_description) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet__SWIG_0) {
  Xapian::ESet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet__SWIG_1) {
  Xapian::ESet *arg1 = 0 ;
  Xapian::ESet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESet. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet((Xapian::ESet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_ESet__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_ESet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESet'";
  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_ESet(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ESet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ESet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ESet resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESet_get_ebound) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_get_ebound. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->get_ebound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESet_size) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_size. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESet_is_empty) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_is_empty. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)Xapian_ESet_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_ESet_begin) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_begin. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_end) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_end. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_back) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_back. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->back();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_get_description) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_get_description. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESetIterator__SWIG_0) {
  Xapian::ESetIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESetIterator__SWIG_1) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESetIterator. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator((Xapian::ESetIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_ESetIterator__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_ESetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESetIterator'";
  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_ESetIterator(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ESetIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ESetIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ESetIterator resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESetIterator_get_termname) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_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_ESetIterator_next) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_next. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESetIterator_prev) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_prev. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESetIterator_equals) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_ESetIterator_get_weight) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_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_ESetIterator_get_description) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet__SWIG_0) {
  Xapian::RSet *arg1 = 0 ;
  Xapian::RSet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_RSet. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet((Xapian::RSet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet__SWIG_1) {
  Xapian::RSet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_RSet__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_RSet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_RSet'";
  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_RSet(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::RSet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__RSet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::RSet resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_RSet_size) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_size. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::RSet const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_RSet_is_empty) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_is_empty. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)Xapian_RSet_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_RSet_add_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_RSet_add_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_add_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->add_document(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_RSet_add_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr( *argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        return _wrap_RSet_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_RSet_add_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_add_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_remove_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_RSet_remove_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->remove_document(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_RSet_remove_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr( *argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        return _wrap_RSet_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_RSet_remove_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_remove_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_contains__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_RSet_contains__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_contains. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_contains. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)(arg1)->contains(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_RSet_contains) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr( *argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        return _wrap_RSet_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_RSet_contains__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_contains'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_get_description) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_get_description. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::RSet const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Enquire *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Enquire. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  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_Enquire(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Enquire *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Enquire TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Enquire resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_query__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::termcount arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_query__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
      }
      if (_v) {
        return _wrap_Enquire_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_Enquire_set_query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_query'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_query) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_weighting_scheme) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Weight, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_collapse_key) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_collapse_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_docid_order) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_docid_order. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::Enquire::docid_order) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_forward) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  bool arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (bool) Z_LVAL_PP(args[1]);
    /*@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_Enquire_set_cutoff__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_cutoff__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@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_Enquire_set_cutoff) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        return _wrap_Enquire_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_Enquire_set_cutoff__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_cutoff'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sorting__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  bool arg4 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[3]);
    arg4 = (bool) Z_LVAL_PP(args[3]);
    /*@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_Enquire_set_sorting__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_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[1]);
    arg2 = (Xapian::valueno) 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 {
      (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_Enquire_set_sorting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__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_Enquire_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_Enquire_set_sorting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sorting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_sort_by_relevance();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[2]);
    arg3 = (bool) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        return _wrap_Enquire_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_Enquire_set_sort_by_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_value'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[2]);
    arg3 = (bool) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_value_then_relevance__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_value_then_relevance) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        return _wrap_Enquire_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_Enquire_set_sort_by_value_then_relevance__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_value_then_relevance'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[2]);
    arg3 = (bool) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_relevance_then_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_set_sort_by_relevance_then_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        return _wrap_Enquire_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_Enquire_set_sort_by_relevance_then_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_relevance_then_value'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_bias) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::weight arg2 ;
  time_t arg3 ;
  time_t *tmp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_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[1]);
    arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &tmp3, SWIGTYPE_p_time_t, 0) < 0 || tmp3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_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_Enquire_get_mset__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  zval **args[6];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5,(Xapian::MatchDecider const *)arg6);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  zval **args[5];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::MSet result;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::MSet result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_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[5];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4,(Xapian::MatchDecider const *)arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_5) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset) {
  int argc;
  zval **argv[6];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          return _wrap_Enquire_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_Enquire_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_Enquire_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_Enquire_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_Enquire_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_Enquire_get_mset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_mset'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  Xapian::ESet result;
  zval **args[6];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (int) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[4]);
    arg5 = (double) Z_DVAL_PP(args[4]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__ExpandDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ESet result;
  zval **args[5];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (int) Z_LVAL_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::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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ESet result;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (int) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ESet result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset) {
  int argc;
  zval **argv[6];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          return _wrap_Enquire_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_Enquire_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_Enquire_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_Enquire_get_eset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_eset'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        return _wrap_Enquire_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_Enquire_get_matching_terms_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_matching_terms_begin'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        return _wrap_Enquire_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_Enquire_get_matching_terms_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_matching_terms_end'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_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[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_register_match_decider. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_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_Enquire_register_match_decider__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_register_match_decider. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->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_Enquire_register_match_decider) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        return _wrap_Enquire_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_Enquire_register_match_decider__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_register_match_decider'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  std::pair<Xapian::TermIterator,Xapian::TermIterator > result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = Xapian_Enquire_get_matching_terms((Xapian::Enquire const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Enquire_get_description) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_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());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_Weight(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Weight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Weight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Weight resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Weight_name) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_name. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Weight_serialise) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_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_Weight_unserialise) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Weight *result = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_unserialise. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::Weight *)((Xapian::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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_sumpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumpart. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[2]);
    /*@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_Weight_get_maxpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_maxpart. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Weight_get_sumextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumextra. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@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_Weight_get_maxextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_maxextra. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Weight_get_sumpart_needs_doclength) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumpart_needs_doclength. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Weight const *)arg1)->get_sumpart_needs_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_clone_object) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::BoolWeight *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_clone_object. 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BoolWeight) {
  Xapian::BoolWeight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  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_BoolWeight(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::BoolWeight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__BoolWeight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::BoolWeight resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_name) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_name. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_serialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_serialise. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_unserialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BoolWeight *result = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_unserialise. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_get_sumpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[2]);
    /*@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_BoolWeight_get_maxpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_maxpart. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_get_sumextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@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_BoolWeight_get_maxextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_maxextra. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BoolWeight_get_sumpart_needs_doclength) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_BM25Weight__SWIG_0) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  Xapian::BM25Weight *result = 0 ;
  zval **args[5];
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BM25Weight__SWIG_1) {
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


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


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_clone_object) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::BM25Weight *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_clone_object. 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);
    *return_value=*_cPtr;
  }
  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_BM25Weight(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::BM25Weight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__BM25Weight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::BM25Weight resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BM25Weight_name) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_name. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BM25Weight_serialise) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_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_BM25Weight_unserialise) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BM25Weight *result = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_unserialise. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_get_sumpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_sumpart. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[2]);
    /*@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_BM25Weight_get_maxpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_maxpart. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BM25Weight_get_sumextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_sumextra. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@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_BM25Weight_get_maxextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_maxextra. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_BM25Weight_get_sumpart_needs_doclength) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_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());
}


ZEND_NAMED_FUNCTION(_wrap_new_TradWeight__SWIG_0) {
  double arg1 ;
  Xapian::TradWeight *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TradWeight__SWIG_1) {
  Xapian::TradWeight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


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


ZEND_NAMED_FUNCTION(_wrap_TradWeight_clone_object) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::TradWeight *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_clone_object. 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);
    *return_value=*_cPtr;
  }
  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_TradWeight(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::TradWeight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__TradWeight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::TradWeight resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TradWeight_name) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_name. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TradWeight_serialise) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_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_TradWeight_unserialise) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TradWeight *result = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_unserialise. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_get_sumpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[2]);
    /*@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_TradWeight_get_maxpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_maxpart. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TradWeight_get_sumextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@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_TradWeight_get_maxextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_maxextra. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_TradWeight_get_sumpart_needs_doclength) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_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());
}


ZEND_NAMED_FUNCTION(_wrap_Database_add_database) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Database_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database__SWIG_0) {
  Xapian::Database *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  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::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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  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_Database(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Database *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Database TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Database resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database__SWIG_2) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((Xapian::Database const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_Database__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_Database__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      return _wrap_new_Database__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Database'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_reopen) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_reopen. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->reopen();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database_get_description) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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_Database_postlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_postlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_postlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_postlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_termlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_termlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_positionlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  std::string temp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_positionlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_positionlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  std::string temp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_positionlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_doccount) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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_Database_get_lastdocid) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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_Database_get_avlength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doclength result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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_Database_get_termfreq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::doccount result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_termfreq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database_term_exists) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_term_exists. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database_get_collection_freq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_collection_freq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database_get_doclength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::doclength result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_Database_keep_alive) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_keep_alive. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->keep_alive();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Database_get_document) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_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[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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);
    *return_value=*_cPtr;
  }
  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_WritableDatabase(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::WritableDatabase *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__WritableDatabase TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::WritableDatabase resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase__SWIG_0) {
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase *result = 0 ;
  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::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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase__SWIG_2) {
  Xapian::WritableDatabase *arg1 = 0 ;
  Xapian::WritableDatabase *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_WritableDatabase. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((Xapian::WritableDatabase const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_WritableDatabase__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_WritableDatabase__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_WritableDatabase__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_WritableDatabase'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_flush) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_flush. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->flush();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_begin_transaction__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[1]);
    arg2 = (bool) Z_LVAL_PP(args[1]);
    /*@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_WritableDatabase_begin_transaction__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->begin_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_begin_transaction) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      return _wrap_WritableDatabase_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_WritableDatabase_begin_transaction__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_begin_transaction'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_commit_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_commit_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->commit_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_cancel_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_cancel_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->cancel_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_add_document) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::docid result;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of WritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_delete_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@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_WritableDatabase_replace_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document *arg3 = 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_delete_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_delete_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        return _wrap_WritableDatabase_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_WritableDatabase_delete_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_delete_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_replace_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  Xapian::docid result;
  std::string temp2 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_WritableDatabase_replace_document) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__Document, 0) == 0);
        }
        if (_v) {
          return _wrap_WritableDatabase_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_WritableDatabase_replace_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_replace_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_get_description) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_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());
}


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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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);
    *return_value=*_cPtr;
  }
  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_Query__SWIG_0) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::termpos arg3 ;
  Xapian::Query *result = 0 ;
  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 = (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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::Query *result = 0 ;
  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 = (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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_2) {
  std::string *arg1 = 0 ;
  Xapian::Query *result = 0 ;
  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::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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_3) {
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::Query *arg3 = 0 ;
  Xapian::Query *result = 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  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_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,(Xapian::Query const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__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();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_5) {
  Xapian::Query *arg1 = 0 ;
  Xapian::Query *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg1, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((Xapian::Query const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__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();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__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();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_8) {
  Xapian::Query::op arg1 ;
  Xapian::Query arg2 ;
  Xapian::Query *result = 0 ;
  Xapian::Query *tmp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  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_Query. 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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_9) {
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_Query__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_Query__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      return _wrap_new_Query__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_Query__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_Query__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_Query__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_Query__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_Query__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_Query__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_Query__SWIG_6(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Query'";
  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_Query(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Query *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Query TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Query resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Query_get_length) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::termcount result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_length. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Query const *)arg1)->get_length();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Query_get_terms_begin) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_terms_begin. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_get_terms_end) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_terms_end. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_is_empty) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_is_empty. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Query const *)arg1)->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_Query_get_description) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_description. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (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_Stopper_apply) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stopper_apply. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      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_Stopper(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Stopper *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Stopper TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Stopper resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Stopper_get_description) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stopper_get_description. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      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_SimpleStopper) {
  Xapian::SimpleStopper *result = 0 ;
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SimpleStopper_add) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_add. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    arg2 = std::string(Z_STRVAL_PP(args[1]),Z_STRLEN_PP(args[1]));
  }
  {
    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_SimpleStopper_apply) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_apply. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (bool)((Xapian::SimpleStopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_SimpleStopper(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::SimpleStopper *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__SimpleStopper TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::SimpleStopper resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_SimpleStopper_get_description) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_get_description. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::SimpleStopper const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser) {
  Xapian::QueryParser *result = 0 ;
  
  SWIG_ResetError();
  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 */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    *return_value=*_cPtr;
  }
  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_QueryParser(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::QueryParser *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__QueryParser TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::QueryParser resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_set_stemmer) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Stem, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_set_stemming_strategy) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::QueryParser::stem_strategy arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stemming_strategy. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::QueryParser::stem_strategy) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_set_stopper__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  {
    try {
      (arg1)->set_stopper(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_QueryParser_set_stopper__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_set_stopper) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      return _wrap_QueryParser_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_QueryParser_set_stopper__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'QueryParser_set_stopper'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_default_op. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::Query::op) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_default_op(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_get_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_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_QueryParser_set_database) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Database *arg2 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_database. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->set_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_parse_query__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Query result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_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[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (unsigned int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_parse_query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        return _wrap_QueryParser_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_QueryParser_parse_query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'QueryParser_parse_query'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_prefix) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_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[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_boolean_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_QueryParser_stoplist_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_stoplist_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_unstem_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TermIterator result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_unstem_begin. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_unstem_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TermIterator result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_unstem_end. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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);
    *return_value=*_cPtr;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_get_description) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_get_description. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Stem) {
  std::string *arg1 = 0 ;
  Xapian::Stem *result = 0 ;
  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::Stem *)new Xapian::Stem((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__Stem, 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);
    *return_value=*_cPtr;
  }
  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_Stem(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Stem *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Stem TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Stem resource already free'd");
  {
    try {
      delete arg1;
      
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Stem_apply) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string *arg2 = 0 ;
  std::string result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Stem, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stem_apply. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::Stem const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Stem_stem_word) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string *arg2 = 0 ;
  std::string result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Stem, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stem_stem_word. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[1]);
    temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg2 = &temp2;
  }
  {
    try {
      result = (arg1)->stem_word((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_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stem_get_description) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Stem, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stem_get_description. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Stem const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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_Stem_get_available_languages) {
  std::string result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = Xapian::Stem::get_available_languages();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, 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());
}


/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ESet) {
  __wrap_delete_ESet(rsrc, SWIGTYPE_p_Xapian__ESet->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_double) {
  /* No destructor for simple type _p_double */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Enquire) {
  __wrap_delete_Enquire(rsrc, SWIGTYPE_p_Xapian__Enquire->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__BoolWeight) {
  __wrap_delete_BoolWeight(rsrc, SWIGTYPE_p_Xapian__BoolWeight->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__TradWeight) {
  __wrap_delete_TradWeight(rsrc, SWIGTYPE_p_Xapian__TradWeight->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__QueryParser) {
  __wrap_delete_QueryParser(rsrc, SWIGTYPE_p_Xapian__QueryParser->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MSet) {
  __wrap_delete_MSet(rsrc, SWIGTYPE_p_Xapian__MSet->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Stopper) {
  __wrap_delete_Stopper(rsrc, SWIGTYPE_p_Xapian__Stopper->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_time_t) {
  /* No destructor for simple type _p_time_t */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__SimpleStopper) {
  __wrap_delete_SimpleStopper(rsrc, SWIGTYPE_p_Xapian__SimpleStopper->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_unsigned_int) {
  /* No destructor for simple type _p_unsigned_int */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_stem_strategy) {
  /* No destructor for simple type _p_stem_strategy */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MatchDecider) {
  /* No destructor for simple type _p_Xapian__MatchDecider */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ExpandDecider) {
  /* No destructor for simple type _p_Xapian__ExpandDecider */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Query) {
  __wrap_delete_Query(rsrc, SWIGTYPE_p_Xapian__Query->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Database) {
  __wrap_delete_Database(rsrc, SWIGTYPE_p_Xapian__Database->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__WritableDatabase) {
  __wrap_delete_WritableDatabase(rsrc, SWIGTYPE_p_Xapian__WritableDatabase->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Document) {
  __wrap_delete_Document(rsrc, SWIGTYPE_p_Xapian__Document->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_docid_order) {
  /* No destructor for simple type _p_docid_order */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_feature_flag) {
  /* No destructor for simple type _p_feature_flag */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Stem) {
  __wrap_delete_Stem(rsrc, SWIGTYPE_p_Xapian__Stem->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_int) {
  /* No destructor for simple type _int */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_int) {
  /* No destructor for simple type _p_int */
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Weight) {
  __wrap_delete_Weight(rsrc, SWIGTYPE_p_Xapian__Weight->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MSetIterator) {
  __wrap_delete_MSetIterator(rsrc, SWIGTYPE_p_Xapian__MSetIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueIterator) {
  __wrap_delete_ValueIterator(rsrc, SWIGTYPE_p_Xapian__ValueIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__TermIterator) {
  __wrap_delete_TermIterator(rsrc, SWIGTYPE_p_Xapian__TermIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__PostingIterator) {
  __wrap_delete_PostingIterator(rsrc, SWIGTYPE_p_Xapian__PostingIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__PositionIterator) {
  __wrap_delete_PositionIterator(rsrc, SWIGTYPE_p_Xapian__PositionIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ESetIterator) {
  __wrap_delete_ESetIterator(rsrc, SWIGTYPE_p_Xapian__ESetIterator->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__RSet) {
  __wrap_delete_RSet(rsrc, SWIGTYPE_p_Xapian__RSet->name TSRMLS_CC);
}
/* NEW Destructor style */
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__BM25Weight) {
  __wrap_delete_BM25Weight(rsrc, SWIGTYPE_p_Xapian__BM25Weight->name TSRMLS_CC);
}
/* end wrapper section */
/* class entry subsection */


/* entry subsection */
/* Every non-class user visible function must have an entry here */
static function_entry xapian_functions[] = {
 ZEND_NAMED_FE(version_string,_wrap_version_string,NULL)
 ZEND_NAMED_FE(major_version,_wrap_major_version,NULL)
 ZEND_NAMED_FE(minor_version,_wrap_minor_version,NULL)
 ZEND_NAMED_FE(revision,_wrap_revision,NULL)
 ZEND_NAMED_FE(new_positioniterator,_wrap_new_PositionIterator,NULL)
 ZEND_NAMED_FE(positioniterator_get_termpos,_wrap_PositionIterator_get_termpos,NULL)
 ZEND_NAMED_FE(positioniterator_next,_wrap_PositionIterator_next,NULL)
 ZEND_NAMED_FE(positioniterator_equals,_wrap_PositionIterator_equals,NULL)
 ZEND_NAMED_FE(positioniterator_skip_to,_wrap_PositionIterator_skip_to,NULL)
 ZEND_NAMED_FE(positioniterator_get_description,_wrap_PositionIterator_get_description,NULL)
 ZEND_NAMED_FE(new_postingiterator,_wrap_new_PostingIterator,NULL)
 ZEND_NAMED_FE(postingiterator_get_docid,_wrap_PostingIterator_get_docid,NULL)
 ZEND_NAMED_FE(postingiterator_next,_wrap_PostingIterator_next,NULL)
 ZEND_NAMED_FE(postingiterator_equals,_wrap_PostingIterator_equals,NULL)
 ZEND_NAMED_FE(postingiterator_skip_to,_wrap_PostingIterator_skip_to,NULL)
 ZEND_NAMED_FE(postingiterator_get_doclength,_wrap_PostingIterator_get_doclength,NULL)
 ZEND_NAMED_FE(postingiterator_get_wdf,_wrap_PostingIterator_get_wdf,NULL)
 ZEND_NAMED_FE(postingiterator_positionlist_begin,_wrap_PostingIterator_positionlist_begin,NULL)
 ZEND_NAMED_FE(postingiterator_positionlist_end,_wrap_PostingIterator_positionlist_end,NULL)
 ZEND_NAMED_FE(postingiterator_get_description,_wrap_PostingIterator_get_description,NULL)
 ZEND_NAMED_FE(new_termiterator,_wrap_new_TermIterator,NULL)
 ZEND_NAMED_FE(termiterator_get_term,_wrap_TermIterator_get_term,NULL)
 ZEND_NAMED_FE(termiterator_next,_wrap_TermIterator_next,NULL)
 ZEND_NAMED_FE(termiterator_equals,_wrap_TermIterator_equals,NULL)
 ZEND_NAMED_FE(termiterator_skip_to,_wrap_TermIterator_skip_to,NULL)
 ZEND_NAMED_FE(termiterator_get_wdf,_wrap_TermIterator_get_wdf,NULL)
 ZEND_NAMED_FE(termiterator_get_termfreq,_wrap_TermIterator_get_termfreq,NULL)
 ZEND_NAMED_FE(termiterator_positionlist_begin,_wrap_TermIterator_positionlist_begin,NULL)
 ZEND_NAMED_FE(termiterator_positionlist_end,_wrap_TermIterator_positionlist_end,NULL)
 ZEND_NAMED_FE(termiterator_get_description,_wrap_TermIterator_get_description,NULL)
 ZEND_NAMED_FE(new_valueiterator,_wrap_new_ValueIterator,NULL)
 ZEND_NAMED_FE(valueiterator_get_value,_wrap_ValueIterator_get_value,NULL)
 ZEND_NAMED_FE(valueiterator_next,_wrap_ValueIterator_next,NULL)
 ZEND_NAMED_FE(valueiterator_equals,_wrap_ValueIterator_equals,NULL)
 ZEND_NAMED_FE(valueiterator_get_valueno,_wrap_ValueIterator_get_valueno,NULL)
 ZEND_NAMED_FE(valueiterator_get_description,_wrap_ValueIterator_get_description,NULL)
 ZEND_NAMED_FE(new_document,_wrap_new_Document,NULL)
 ZEND_NAMED_FE(document_get_value,_wrap_Document_get_value,NULL)
 ZEND_NAMED_FE(document_add_value,_wrap_Document_add_value,NULL)
 ZEND_NAMED_FE(document_remove_value,_wrap_Document_remove_value,NULL)
 ZEND_NAMED_FE(document_clear_values,_wrap_Document_clear_values,NULL)
 ZEND_NAMED_FE(document_get_data,_wrap_Document_get_data,NULL)
 ZEND_NAMED_FE(document_set_data,_wrap_Document_set_data,NULL)
 ZEND_NAMED_FE(document_add_posting,_wrap_Document_add_posting,NULL)
 ZEND_NAMED_FE(document_add_term,_wrap_Document_add_term,NULL)
 ZEND_NAMED_FE(document_add_term_nopos,_wrap_Document_add_term_nopos,NULL)
 ZEND_NAMED_FE(document_remove_posting,_wrap_Document_remove_posting,NULL)
 ZEND_NAMED_FE(document_remove_term,_wrap_Document_remove_term,NULL)
 ZEND_NAMED_FE(document_clear_terms,_wrap_Document_clear_terms,NULL)
 ZEND_NAMED_FE(document_termlist_count,_wrap_Document_termlist_count,NULL)
 ZEND_NAMED_FE(document_termlist_begin,_wrap_Document_termlist_begin,NULL)
 ZEND_NAMED_FE(document_termlist_end,_wrap_Document_termlist_end,NULL)
 ZEND_NAMED_FE(document_values_count,_wrap_Document_values_count,NULL)
 ZEND_NAMED_FE(document_values_begin,_wrap_Document_values_begin,NULL)
 ZEND_NAMED_FE(document_values_end,_wrap_Document_values_end,NULL)
 ZEND_NAMED_FE(document_get_description,_wrap_Document_get_description,NULL)
 ZEND_NAMED_FE(new_mset,_wrap_new_MSet,NULL)
 ZEND_NAMED_FE(mset_fetch,_wrap_MSet_fetch,NULL)
 ZEND_NAMED_FE(mset_convert_to_percent,_wrap_MSet_convert_to_percent,NULL)
 ZEND_NAMED_FE(mset_get_termfreq,_wrap_MSet_get_termfreq,NULL)
 ZEND_NAMED_FE(mset_get_termweight,_wrap_MSet_get_termweight,NULL)
 ZEND_NAMED_FE(mset_get_firstitem,_wrap_MSet_get_firstitem,NULL)
 ZEND_NAMED_FE(mset_get_matches_lower_bound,_wrap_MSet_get_matches_lower_bound,NULL)
 ZEND_NAMED_FE(mset_get_matches_estimated,_wrap_MSet_get_matches_estimated,NULL)
 ZEND_NAMED_FE(mset_get_matches_upper_bound,_wrap_MSet_get_matches_upper_bound,NULL)
 ZEND_NAMED_FE(mset_get_max_possible,_wrap_MSet_get_max_possible,NULL)
 ZEND_NAMED_FE(mset_get_max_attained,_wrap_MSet_get_max_attained,NULL)
 ZEND_NAMED_FE(mset_size,_wrap_MSet_size,NULL)
 ZEND_NAMED_FE(mset_is_empty,_wrap_MSet_is_empty,NULL)
 ZEND_NAMED_FE(mset_begin,_wrap_MSet_begin,NULL)
 ZEND_NAMED_FE(mset_end,_wrap_MSet_end,NULL)
 ZEND_NAMED_FE(mset_back,_wrap_MSet_back,NULL)
 ZEND_NAMED_FE(mset_get_hit,_wrap_MSet_get_hit,NULL)
 ZEND_NAMED_FE(mset_get_document_percentage,_wrap_MSet_get_document_percentage,NULL)
 ZEND_NAMED_FE(mset_get_document,_wrap_MSet_get_document,NULL)
 ZEND_NAMED_FE(mset_get_docid,_wrap_MSet_get_docid,NULL)
 ZEND_NAMED_FE(mset_get_document_id,_wrap_MSet_get_document_id,NULL)
 ZEND_NAMED_FE(mset_get_description,_wrap_MSet_get_description,NULL)
 ZEND_NAMED_FE(new_msetiterator,_wrap_new_MSetIterator,NULL)
 ZEND_NAMED_FE(msetiterator_get_docid,_wrap_MSetIterator_get_docid,NULL)
 ZEND_NAMED_FE(msetiterator_next,_wrap_MSetIterator_next,NULL)
 ZEND_NAMED_FE(msetiterator_prev,_wrap_MSetIterator_prev,NULL)
 ZEND_NAMED_FE(msetiterator_equals,_wrap_MSetIterator_equals,NULL)
 ZEND_NAMED_FE(msetiterator_get_document,_wrap_MSetIterator_get_document,NULL)
 ZEND_NAMED_FE(msetiterator_get_rank,_wrap_MSetIterator_get_rank,NULL)
 ZEND_NAMED_FE(msetiterator_get_weight,_wrap_MSetIterator_get_weight,NULL)
 ZEND_NAMED_FE(msetiterator_get_collapse_count,_wrap_MSetIterator_get_collapse_count,NULL)
 ZEND_NAMED_FE(msetiterator_get_percent,_wrap_MSetIterator_get_percent,NULL)
 ZEND_NAMED_FE(msetiterator_get_description,_wrap_MSetIterator_get_description,NULL)
 ZEND_NAMED_FE(new_eset,_wrap_new_ESet,NULL)
 ZEND_NAMED_FE(eset_get_ebound,_wrap_ESet_get_ebound,NULL)
 ZEND_NAMED_FE(eset_size,_wrap_ESet_size,NULL)
 ZEND_NAMED_FE(eset_is_empty,_wrap_ESet_is_empty,NULL)
 ZEND_NAMED_FE(eset_begin,_wrap_ESet_begin,NULL)
 ZEND_NAMED_FE(eset_end,_wrap_ESet_end,NULL)
 ZEND_NAMED_FE(eset_back,_wrap_ESet_back,NULL)
 ZEND_NAMED_FE(eset_get_description,_wrap_ESet_get_description,NULL)
 ZEND_NAMED_FE(new_esetiterator,_wrap_new_ESetIterator,NULL)
 ZEND_NAMED_FE(esetiterator_get_termname,_wrap_ESetIterator_get_termname,NULL)
 ZEND_NAMED_FE(esetiterator_next,_wrap_ESetIterator_next,NULL)
 ZEND_NAMED_FE(esetiterator_prev,_wrap_ESetIterator_prev,NULL)
 ZEND_NAMED_FE(esetiterator_equals,_wrap_ESetIterator_equals,NULL)
 ZEND_NAMED_FE(esetiterator_get_weight,_wrap_ESetIterator_get_weight,NULL)
 ZEND_NAMED_FE(esetiterator_get_description,_wrap_ESetIterator_get_description,NULL)
 ZEND_NAMED_FE(new_rset,_wrap_new_RSet,NULL)
 ZEND_NAMED_FE(rset_size,_wrap_RSet_size,NULL)
 ZEND_NAMED_FE(rset_is_empty,_wrap_RSet_is_empty,NULL)
 ZEND_NAMED_FE(rset_add_document,_wrap_RSet_add_document,NULL)
 ZEND_NAMED_FE(rset_remove_document,_wrap_RSet_remove_document,NULL)
 ZEND_NAMED_FE(rset_contains,_wrap_RSet_contains,NULL)
 ZEND_NAMED_FE(rset_get_description,_wrap_RSet_get_description,NULL)
 ZEND_NAMED_FE(new_enquire,_wrap_new_Enquire,NULL)
 ZEND_NAMED_FE(enquire_set_query,_wrap_Enquire_set_query,NULL)
 ZEND_NAMED_FE(enquire_get_query,_wrap_Enquire_get_query,NULL)
 ZEND_NAMED_FE(enquire_set_weighting_scheme,_wrap_Enquire_set_weighting_scheme,NULL)
 ZEND_NAMED_FE(enquire_set_collapse_key,_wrap_Enquire_set_collapse_key,NULL)
 ZEND_NAMED_FE(enquire_set_docid_order,_wrap_Enquire_set_docid_order,NULL)
 ZEND_NAMED_FE(enquire_set_sort_forward,_wrap_Enquire_set_sort_forward,NULL)
 ZEND_NAMED_FE(enquire_set_cutoff,_wrap_Enquire_set_cutoff,NULL)
 ZEND_NAMED_FE(enquire_set_sorting,_wrap_Enquire_set_sorting,NULL)
 ZEND_NAMED_FE(enquire_set_sort_by_relevance,_wrap_Enquire_set_sort_by_relevance,NULL)
 ZEND_NAMED_FE(enquire_set_sort_by_value,_wrap_Enquire_set_sort_by_value,NULL)
 ZEND_NAMED_FE(enquire_set_sort_by_value_then_relevance,_wrap_Enquire_set_sort_by_value_then_relevance,NULL)
 ZEND_NAMED_FE(enquire_set_sort_by_relevance_then_value,_wrap_Enquire_set_sort_by_relevance_then_value,NULL)
 ZEND_NAMED_FE(enquire_set_bias,_wrap_Enquire_set_bias,NULL)
 ZEND_NAMED_FE(enquire_get_mset,_wrap_Enquire_get_mset,NULL)
 ZEND_NAMED_FE(enquire_get_eset,_wrap_Enquire_get_eset,NULL)
 ZEND_NAMED_FE(enquire_get_matching_terms_begin,_wrap_Enquire_get_matching_terms_begin,NULL)
 ZEND_NAMED_FE(enquire_get_matching_terms_end,_wrap_Enquire_get_matching_terms_end,NULL)
 ZEND_NAMED_FE(enquire_register_match_decider,_wrap_Enquire_register_match_decider,NULL)
 ZEND_NAMED_FE(enquire_get_matching_terms,_wrap_Enquire_get_matching_terms,NULL)
 ZEND_NAMED_FE(enquire_get_description,_wrap_Enquire_get_description,NULL)
 ZEND_NAMED_FE(weight_name,_wrap_Weight_name,NULL)
 ZEND_NAMED_FE(weight_serialise,_wrap_Weight_serialise,NULL)
 ZEND_NAMED_FE(weight_unserialise,_wrap_Weight_unserialise,NULL)
 ZEND_NAMED_FE(weight_get_sumpart,_wrap_Weight_get_sumpart,NULL)
 ZEND_NAMED_FE(weight_get_maxpart,_wrap_Weight_get_maxpart,NULL)
 ZEND_NAMED_FE(weight_get_sumextra,_wrap_Weight_get_sumextra,NULL)
 ZEND_NAMED_FE(weight_get_maxextra,_wrap_Weight_get_maxextra,NULL)
 ZEND_NAMED_FE(weight_get_sumpart_needs_doclength,_wrap_Weight_get_sumpart_needs_doclength,NULL)
 ZEND_NAMED_FE(boolweight_clone_object,_wrap_BoolWeight_clone_object,NULL)
 ZEND_NAMED_FE(new_boolweight,_wrap_new_BoolWeight,NULL)
 ZEND_NAMED_FE(boolweight_name,_wrap_BoolWeight_name,NULL)
 ZEND_NAMED_FE(boolweight_serialise,_wrap_BoolWeight_serialise,NULL)
 ZEND_NAMED_FE(boolweight_unserialise,_wrap_BoolWeight_unserialise,NULL)
 ZEND_NAMED_FE(boolweight_get_sumpart,_wrap_BoolWeight_get_sumpart,NULL)
 ZEND_NAMED_FE(boolweight_get_maxpart,_wrap_BoolWeight_get_maxpart,NULL)
 ZEND_NAMED_FE(boolweight_get_sumextra,_wrap_BoolWeight_get_sumextra,NULL)
 ZEND_NAMED_FE(boolweight_get_maxextra,_wrap_BoolWeight_get_maxextra,NULL)
 ZEND_NAMED_FE(boolweight_get_sumpart_needs_doclength,_wrap_BoolWeight_get_sumpart_needs_doclength,NULL)
 ZEND_NAMED_FE(new_bm25weight,_wrap_new_BM25Weight,NULL)
 ZEND_NAMED_FE(bm25weight_clone_object,_wrap_BM25Weight_clone_object,NULL)
 ZEND_NAMED_FE(bm25weight_name,_wrap_BM25Weight_name,NULL)
 ZEND_NAMED_FE(bm25weight_serialise,_wrap_BM25Weight_serialise,NULL)
 ZEND_NAMED_FE(bm25weight_unserialise,_wrap_BM25Weight_unserialise,NULL)
 ZEND_NAMED_FE(bm25weight_get_sumpart,_wrap_BM25Weight_get_sumpart,NULL)
 ZEND_NAMED_FE(bm25weight_get_maxpart,_wrap_BM25Weight_get_maxpart,NULL)
 ZEND_NAMED_FE(bm25weight_get_sumextra,_wrap_BM25Weight_get_sumextra,NULL)
 ZEND_NAMED_FE(bm25weight_get_maxextra,_wrap_BM25Weight_get_maxextra,NULL)
 ZEND_NAMED_FE(bm25weight_get_sumpart_needs_doclength,_wrap_BM25Weight_get_sumpart_needs_doclength,NULL)
 ZEND_NAMED_FE(new_tradweight,_wrap_new_TradWeight,NULL)
 ZEND_NAMED_FE(tradweight_clone_object,_wrap_TradWeight_clone_object,NULL)
 ZEND_NAMED_FE(tradweight_name,_wrap_TradWeight_name,NULL)
 ZEND_NAMED_FE(tradweight_serialise,_wrap_TradWeight_serialise,NULL)
 ZEND_NAMED_FE(tradweight_unserialise,_wrap_TradWeight_unserialise,NULL)
 ZEND_NAMED_FE(tradweight_get_sumpart,_wrap_TradWeight_get_sumpart,NULL)
 ZEND_NAMED_FE(tradweight_get_maxpart,_wrap_TradWeight_get_maxpart,NULL)
 ZEND_NAMED_FE(tradweight_get_sumextra,_wrap_TradWeight_get_sumextra,NULL)
 ZEND_NAMED_FE(tradweight_get_maxextra,_wrap_TradWeight_get_maxextra,NULL)
 ZEND_NAMED_FE(tradweight_get_sumpart_needs_doclength,_wrap_TradWeight_get_sumpart_needs_doclength,NULL)
 ZEND_NAMED_FE(database_add_database,_wrap_Database_add_database,NULL)
 ZEND_NAMED_FE(new_database,_wrap_new_Database,NULL)
 ZEND_NAMED_FE(database_reopen,_wrap_Database_reopen,NULL)
 ZEND_NAMED_FE(database_get_description,_wrap_Database_get_description,NULL)
 ZEND_NAMED_FE(database_postlist_begin,_wrap_Database_postlist_begin,NULL)
 ZEND_NAMED_FE(database_postlist_end,_wrap_Database_postlist_end,NULL)
 ZEND_NAMED_FE(database_termlist_begin,_wrap_Database_termlist_begin,NULL)
 ZEND_NAMED_FE(database_termlist_end,_wrap_Database_termlist_end,NULL)
 ZEND_NAMED_FE(database_positionlist_begin,_wrap_Database_positionlist_begin,NULL)
 ZEND_NAMED_FE(database_positionlist_end,_wrap_Database_positionlist_end,NULL)
 ZEND_NAMED_FE(database_allterms_begin,_wrap_Database_allterms_begin,NULL)
 ZEND_NAMED_FE(database_allterms_end,_wrap_Database_allterms_end,NULL)
 ZEND_NAMED_FE(database_get_doccount,_wrap_Database_get_doccount,NULL)
 ZEND_NAMED_FE(database_get_lastdocid,_wrap_Database_get_lastdocid,NULL)
 ZEND_NAMED_FE(database_get_avlength,_wrap_Database_get_avlength,NULL)
 ZEND_NAMED_FE(database_get_termfreq,_wrap_Database_get_termfreq,NULL)
 ZEND_NAMED_FE(database_term_exists,_wrap_Database_term_exists,NULL)
 ZEND_NAMED_FE(database_get_collection_freq,_wrap_Database_get_collection_freq,NULL)
 ZEND_NAMED_FE(database_get_doclength,_wrap_Database_get_doclength,NULL)
 ZEND_NAMED_FE(database_keep_alive,_wrap_Database_keep_alive,NULL)
 ZEND_NAMED_FE(database_get_document,_wrap_Database_get_document,NULL)
 ZEND_NAMED_FE(new_writabledatabase,_wrap_new_WritableDatabase,NULL)
 ZEND_NAMED_FE(writabledatabase_flush,_wrap_WritableDatabase_flush,NULL)
 ZEND_NAMED_FE(writabledatabase_begin_transaction,_wrap_WritableDatabase_begin_transaction,NULL)
 ZEND_NAMED_FE(writabledatabase_commit_transaction,_wrap_WritableDatabase_commit_transaction,NULL)
 ZEND_NAMED_FE(writabledatabase_cancel_transaction,_wrap_WritableDatabase_cancel_transaction,NULL)
 ZEND_NAMED_FE(writabledatabase_add_document,_wrap_WritableDatabase_add_document,NULL)
 ZEND_NAMED_FE(writabledatabase_delete_document,_wrap_WritableDatabase_delete_document,NULL)
 ZEND_NAMED_FE(writabledatabase_replace_document,_wrap_WritableDatabase_replace_document,NULL)
 ZEND_NAMED_FE(writabledatabase_get_description,_wrap_WritableDatabase_get_description,NULL)
 ZEND_NAMED_FE(auto_open,_wrap_auto_open,NULL)
 ZEND_NAMED_FE(auto_open_stub,_wrap_auto_open_stub,NULL)
 ZEND_NAMED_FE(quartz_open,_wrap_quartz_open,NULL)
 ZEND_NAMED_FE(flint_open,_wrap_flint_open,NULL)
 ZEND_NAMED_FE(inmemory_open,_wrap_inmemory_open,NULL)
 ZEND_NAMED_FE(muscat36_open_da,_wrap_muscat36_open_da,NULL)
 ZEND_NAMED_FE(muscat36_open_db,_wrap_muscat36_open_db,NULL)
 ZEND_NAMED_FE(remote_open,_wrap_remote_open,NULL)
 ZEND_NAMED_FE(remote_open_writable,_wrap_remote_open_writable,NULL)
 ZEND_NAMED_FE(new_query,_wrap_new_Query,NULL)
 ZEND_NAMED_FE(query_get_length,_wrap_Query_get_length,NULL)
 ZEND_NAMED_FE(query_get_terms_begin,_wrap_Query_get_terms_begin,NULL)
 ZEND_NAMED_FE(query_get_terms_end,_wrap_Query_get_terms_end,NULL)
 ZEND_NAMED_FE(query_is_empty,_wrap_Query_is_empty,NULL)
 ZEND_NAMED_FE(query_get_description,_wrap_Query_get_description,NULL)
 ZEND_NAMED_FE(stopper_apply,_wrap_Stopper_apply,NULL)
 ZEND_NAMED_FE(stopper_get_description,_wrap_Stopper_get_description,NULL)
 ZEND_NAMED_FE(new_simplestopper,_wrap_new_SimpleStopper,NULL)
 ZEND_NAMED_FE(simplestopper_add,_wrap_SimpleStopper_add,NULL)
 ZEND_NAMED_FE(simplestopper_apply,_wrap_SimpleStopper_apply,NULL)
 ZEND_NAMED_FE(simplestopper_get_description,_wrap_SimpleStopper_get_description,NULL)
 ZEND_NAMED_FE(new_queryparser,_wrap_new_QueryParser,NULL)
 ZEND_NAMED_FE(queryparser_set_stemmer,_wrap_QueryParser_set_stemmer,NULL)
 ZEND_NAMED_FE(queryparser_set_stemming_strategy,_wrap_QueryParser_set_stemming_strategy,NULL)
 ZEND_NAMED_FE(queryparser_set_stopper,_wrap_QueryParser_set_stopper,NULL)
 ZEND_NAMED_FE(queryparser_set_default_op,_wrap_QueryParser_set_default_op,NULL)
 ZEND_NAMED_FE(queryparser_get_default_op,_wrap_QueryParser_get_default_op,NULL)
 ZEND_NAMED_FE(queryparser_set_database,_wrap_QueryParser_set_database,NULL)
 ZEND_NAMED_FE(queryparser_parse_query,_wrap_QueryParser_parse_query,NULL)
 ZEND_NAMED_FE(queryparser_add_prefix,_wrap_QueryParser_add_prefix,NULL)
 ZEND_NAMED_FE(queryparser_add_boolean_prefix,_wrap_QueryParser_add_boolean_prefix,NULL)
 ZEND_NAMED_FE(queryparser_stoplist_begin,_wrap_QueryParser_stoplist_begin,NULL)
 ZEND_NAMED_FE(queryparser_stoplist_end,_wrap_QueryParser_stoplist_end,NULL)
 ZEND_NAMED_FE(queryparser_unstem_begin,_wrap_QueryParser_unstem_begin,NULL)
 ZEND_NAMED_FE(queryparser_unstem_end,_wrap_QueryParser_unstem_end,NULL)
 ZEND_NAMED_FE(queryparser_get_description,_wrap_QueryParser_get_description,NULL)
 ZEND_NAMED_FE(new_stem,_wrap_new_Stem,NULL)
 ZEND_NAMED_FE(stem_apply,_wrap_Stem_apply,NULL)
 ZEND_NAMED_FE(stem_stem_word,_wrap_Stem_stem_word,NULL)
 ZEND_NAMED_FE(stem_get_description,_wrap_Stem_get_description,NULL)
 ZEND_NAMED_FE(stem_get_available_languages,_wrap_Stem_get_available_languages,NULL)
{NULL, NULL, NULL}
};

/* init section */
zend_module_entry xapian_module_entry = {
#if ZEND_MODULE_API_NO > 20010900
    STANDARD_MODULE_HEADER,
#endif
    "xapian",
    xapian_functions,
    PHP_MINIT(xapian),
    PHP_MSHUTDOWN(xapian),
    PHP_RINIT(xapian),
    PHP_RSHUTDOWN(xapian),
    PHP_MINFO(xapian),
#if ZEND_MODULE_API_NO > 20010900
    NO_VERSION_YET,
#endif
    STANDARD_MODULE_PROPERTIES
};
zend_module_entry* SWIG_module_entry = &xapian_module_entry;

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

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

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

#if 0
#define SWIGRUNTIME_DEBUG
#endif


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

  clientdata = clientdata;

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

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

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

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

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

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

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

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

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

  if (init_run) return;
  init_run = 1;

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

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


  SWIG_php_minit {
    SWIG_InitializeModule(0);

/* oinit subsection */
ZEND_INIT_MODULE_GLOBALS(xapian, xapian_init_globals, xapian_destroy_globals);

/* Register resource destructors for pointer types */
le_swig__p_Xapian__ESet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ESet,NULL,(char *)(SWIGTYPE_p_Xapian__ESet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESet,&le_swig__p_Xapian__ESet);
le_swig__p_double=zend_register_list_destructors_ex(_wrap_destroy_p_double,NULL,(char *)(SWIGTYPE_p_double->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_double,&le_swig__p_double);
le_swig__p_Xapian__Enquire=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Enquire,NULL,(char *)(SWIGTYPE_p_Xapian__Enquire->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Enquire,&le_swig__p_Xapian__Enquire);
le_swig__p_Xapian__BoolWeight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__BoolWeight,NULL,(char *)(SWIGTYPE_p_Xapian__BoolWeight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__BoolWeight,&le_swig__p_Xapian__BoolWeight);
le_swig__p_Xapian__TradWeight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__TradWeight,NULL,(char *)(SWIGTYPE_p_Xapian__TradWeight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__TradWeight,&le_swig__p_Xapian__TradWeight);
le_swig__p_Xapian__QueryParser=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__QueryParser,NULL,(char *)(SWIGTYPE_p_Xapian__QueryParser->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__QueryParser,&le_swig__p_Xapian__QueryParser);
le_swig__p_Xapian__MSet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MSet,NULL,(char *)(SWIGTYPE_p_Xapian__MSet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSet,&le_swig__p_Xapian__MSet);
le_swig__p_Xapian__Stopper=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Stopper,NULL,(char *)(SWIGTYPE_p_Xapian__Stopper->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stopper,&le_swig__p_Xapian__Stopper);
le_swig__p_time_t=zend_register_list_destructors_ex(_wrap_destroy_p_time_t,NULL,(char *)(SWIGTYPE_p_time_t->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_time_t,&le_swig__p_time_t);
le_swig__p_Xapian__SimpleStopper=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__SimpleStopper,NULL,(char *)(SWIGTYPE_p_Xapian__SimpleStopper->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__SimpleStopper,&le_swig__p_Xapian__SimpleStopper);
le_swig__p_unsigned_int=zend_register_list_destructors_ex(_wrap_destroy_p_unsigned_int,NULL,(char *)(SWIGTYPE_p_unsigned_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_unsigned_int,&le_swig__p_unsigned_int);
le_swig__p_stem_strategy=zend_register_list_destructors_ex(_wrap_destroy_p_stem_strategy,NULL,(char *)(SWIGTYPE_p_stem_strategy->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_stem_strategy,&le_swig__p_stem_strategy);
le_swig__p_Xapian__MatchDecider=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MatchDecider,NULL,(char *)(SWIGTYPE_p_Xapian__MatchDecider->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MatchDecider,&le_swig__p_Xapian__MatchDecider);
le_swig__p_Xapian__ExpandDecider=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ExpandDecider,NULL,(char *)(SWIGTYPE_p_Xapian__ExpandDecider->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ExpandDecider,&le_swig__p_Xapian__ExpandDecider);
le_swig__p_Xapian__Query=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Query,NULL,(char *)(SWIGTYPE_p_Xapian__Query->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Query,&le_swig__p_Xapian__Query);
le_swig__p_Xapian__Database=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Database,NULL,(char *)(SWIGTYPE_p_Xapian__Database->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Database,&le_swig__p_Xapian__Database);
le_swig__p_Xapian__WritableDatabase=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__WritableDatabase,NULL,(char *)(SWIGTYPE_p_Xapian__WritableDatabase->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__WritableDatabase,&le_swig__p_Xapian__WritableDatabase);
le_swig__p_Xapian__Document=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Document,NULL,(char *)(SWIGTYPE_p_Xapian__Document->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Document,&le_swig__p_Xapian__Document);
le_swig__p_docid_order=zend_register_list_destructors_ex(_wrap_destroy_p_docid_order,NULL,(char *)(SWIGTYPE_p_docid_order->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_docid_order,&le_swig__p_docid_order);
le_swig__p_feature_flag=zend_register_list_destructors_ex(_wrap_destroy_p_feature_flag,NULL,(char *)(SWIGTYPE_p_feature_flag->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_feature_flag,&le_swig__p_feature_flag);
le_swig__p_Xapian__Stem=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Stem,NULL,(char *)(SWIGTYPE_p_Xapian__Stem->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stem,&le_swig__p_Xapian__Stem);
le_swig__int=zend_register_list_destructors_ex(_wrap_destroy_int,NULL,(char *)(SWIGTYPE_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_int,&le_swig__int);
le_swig__p_int=zend_register_list_destructors_ex(_wrap_destroy_p_int,NULL,(char *)(SWIGTYPE_p_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_int,&le_swig__p_int);
le_swig__p_Xapian__Weight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Weight,NULL,(char *)(SWIGTYPE_p_Xapian__Weight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Weight,&le_swig__p_Xapian__Weight);
le_swig__p_Xapian__MSetIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MSetIterator,NULL,(char *)(SWIGTYPE_p_Xapian__MSetIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSetIterator,&le_swig__p_Xapian__MSetIterator);
le_swig__p_Xapian__ValueIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueIterator,NULL,(char *)(SWIGTYPE_p_Xapian__ValueIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueIterator,&le_swig__p_Xapian__ValueIterator);
le_swig__p_Xapian__TermIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__TermIterator,NULL,(char *)(SWIGTYPE_p_Xapian__TermIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__TermIterator,&le_swig__p_Xapian__TermIterator);
le_swig__p_Xapian__PostingIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__PostingIterator,NULL,(char *)(SWIGTYPE_p_Xapian__PostingIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__PostingIterator,&le_swig__p_Xapian__PostingIterator);
le_swig__p_Xapian__PositionIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__PositionIterator,NULL,(char *)(SWIGTYPE_p_Xapian__PositionIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__PositionIterator,&le_swig__p_Xapian__PositionIterator);
le_swig__p_Xapian__ESetIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ESetIterator,NULL,(char *)(SWIGTYPE_p_Xapian__ESetIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESetIterator,&le_swig__p_Xapian__ESetIterator);
le_swig__p_Xapian__RSet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__RSet,NULL,(char *)(SWIGTYPE_p_Xapian__RSet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__RSet,&le_swig__p_Xapian__RSet);
le_swig__p_Xapian__BM25Weight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__BM25Weight,NULL,(char *)(SWIGTYPE_p_Xapian__BM25Weight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__BM25Weight,&le_swig__p_Xapian__BM25Weight);
CG(active_class_entry) = NULL;
/* end oinit subsection */

/* cinit subsection */
REGISTER_LONG_CONSTANT("Enquire_ASCENDING", Xapian::Enquire::ASCENDING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Enquire_DESCENDING", Xapian::Enquire::DESCENDING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Enquire_DONT_CARE", Xapian::Enquire::DONT_CARE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_CREATE_OR_OPEN", 1, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_CREATE", 2, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_CREATE_OR_OVERWRITE", 3, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_OPEN", 4, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_AND", Xapian::Query::OP_AND, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_OR", Xapian::Query::OP_OR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_AND_NOT", Xapian::Query::OP_AND_NOT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_XOR", Xapian::Query::OP_XOR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_AND_MAYBE", Xapian::Query::OP_AND_MAYBE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_FILTER", Xapian::Query::OP_FILTER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_NEAR", Xapian::Query::OP_NEAR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_PHRASE", Xapian::Query::OP_PHRASE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("Query_OP_ELITE_SET", Xapian::Query::OP_ELITE_SET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_FLAG_BOOLEAN", Xapian::QueryParser::FLAG_BOOLEAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_FLAG_PHRASE", Xapian::QueryParser::FLAG_PHRASE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_FLAG_LOVEHATE", Xapian::QueryParser::FLAG_LOVEHATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_FLAG_BOOLEAN_ANY_CASE", Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_FLAG_WILDCARD", Xapian::QueryParser::FLAG_WILDCARD, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_STEM_NONE", Xapian::QueryParser::STEM_NONE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_STEM_SOME", Xapian::QueryParser::STEM_SOME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("QueryParser_STEM_ALL", Xapian::QueryParser::STEM_ALL, CONST_CS | CONST_PERSISTENT);
/* end cinit subsection */

    return SUCCESS;
}

PHP_RINIT_FUNCTION(xapian)
{
/* rinit section */

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

    return SUCCESS;
}

PHP_MSHUTDOWN_FUNCTION(xapian)
{
/* shutdown section */

    return SUCCESS;
}

PHP_RSHUTDOWN_FUNCTION(xapian)
{
/* rshutdown section */

    return SUCCESS;
}

PHP_MINFO_FUNCTION(xapian)
{

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

}
/* end init section */

Generated by  Doxygen 1.6.0   Back to index