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

// The Ruby 2.3 headers contain things which cause warnings with more recent
// C++ compilers.  There's nothing we can really do about them, so just
// suppress them.
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wreserved-user-defined-literal"
#elif defined __GNUC__
// Warning added in GCC 4.8 and we don't support anything older.
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wliteral-suffix"
#endif

#if defined __clang__ && !defined _WIN32
// Ruby 3.0.0 tries to use __declspec on non-Microsoft platforms because
// clang's __has_declspec_attribute(x) gives 1 even when __declspec support
// isn't actually enabled.  We undefine __has_declspec_attribute to avoid
// this, and suppress the warning clang gives about undefining a builtin macro.
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wbuiltin-macro-redefined"
# undef __has_declspec_attribute
# pragma clang diagnostic pop
#endif

#include <ruby.h>
#include <ruby/version.h>

#ifdef __clang__
# pragma clang diagnostic pop
#elif defined __GNUC__
# pragma GCC diagnostic pop
#endif



#ifndef SWIGRUBY
#define SWIGRUBY
#endif

#define SWIG_DIRECTORS


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif

/* Intel's compiler complains if a variable which was never initialised is
 * cast to void, which is a common idiom which we use to indicate that we
 * are aware a variable isn't used.  So we just silence that warning.
 * See: https://github.com/swig/swig/issues/192 for more discussion.
 */
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif

/* Intel's compiler complains if a variable which was never initialised is
 * cast to void, which is a common idiom which we use to indicate that we
 * are aware a variable isn't used.  So we just silence that warning.
 * See: https://github.com/swig/swig/issues/192 for more discussion.
 */
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif

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

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

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

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

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

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

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

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

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


/*
   Flags/methods for returning states.

   The SWIG conversion methods, as ConvertPtr, return an integer
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).

   Use the following macros/flags to set or process the returning
   states.

   In old versions of SWIG, code such as the following was usually written:

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

   Now you can be more explicit:

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

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

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }

   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

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

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

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

       int food(double)
       int fooi(int);

   and you call

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

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

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

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

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


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

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

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

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

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

/*
  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) {
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}

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

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

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

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

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

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

/*
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;

  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}

/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
                            swig_module_info *end,
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      size_t l = 0;
      size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  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 {
      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";
  const unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    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) {
  unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    char d = *(c++);
    unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = (unsigned char)((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = (unsigned char)((d - ('a'-10)) << 4);
    else
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (unsigned char)(d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (unsigned char)(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

/*  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



#include <ruby.h>
#include <ruby/version.h>

/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
 * breaks using rb_intern as an lvalue, as SWIG does.  We work around this
 * issue for now by disabling this.
 * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
 */
#ifdef rb_intern
# undef rb_intern
#endif

/* Remove global macros defined in Ruby's win32.h */
#ifdef write
# undef write
#endif
#ifdef read
# undef read
#endif
#ifdef bind
# undef bind
#endif
#ifdef close
# undef close
#endif
#ifdef connect
# undef connect
#endif


/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
#ifndef NUM2LL
#define NUM2LL(x) NUM2LONG((x))
#endif
#ifndef LL2NUM
#define LL2NUM(x) INT2NUM((long) (x))
#endif
#ifndef ULL2NUM
#define ULL2NUM(x) UINT2NUM((unsigned long) (x))
#endif

/* Ruby 1.7 doesn't (yet) define NUM2ULL() */
#ifndef NUM2ULL
#ifdef HAVE_LONG_LONG
#define NUM2ULL(x) rb_num2ull((x))
#else
#define NUM2ULL(x) NUM2ULONG(x)
#endif
#endif

/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
/* Define these for older versions so we can just write code the new way */
#ifndef RSTRING_LEN
# define RSTRING_LEN(x) RSTRING(x)->len
#endif
#ifndef RSTRING_PTR
# define RSTRING_PTR(x) RSTRING(x)->ptr
#endif
#ifndef RSTRING_END
# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
#endif
#ifndef RARRAY_LEN
# define RARRAY_LEN(x) RARRAY(x)->len
#endif
#ifndef RARRAY_PTR
# define RARRAY_PTR(x) RARRAY(x)->ptr
#endif
#ifndef RFLOAT_VALUE
# define RFLOAT_VALUE(x) RFLOAT(x)->value
#endif
#ifndef DOUBLE2NUM
# define DOUBLE2NUM(x) rb_float_new(x)
#endif
#ifndef RHASH_TBL
# define RHASH_TBL(x) (RHASH(x)->tbl)
#endif
#ifndef RHASH_ITER_LEV
# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
#endif
#ifndef RHASH_IFNONE
# define RHASH_IFNONE(x) (RHASH(x)->ifnone)
#endif
#ifndef RHASH_SIZE
# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
#endif
#ifndef RHASH_EMPTY_P
# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
#endif
#ifndef RSTRUCT_LEN
# define RSTRUCT_LEN(x) RSTRUCT(x)->len
#endif
#ifndef RSTRUCT_PTR
# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
#endif



/*
 * Need to be very careful about how these macros are defined, especially
 * when compiling C++ code or C code with an ANSI C compiler.
 *
 * VALUEFUNC(f) is a macro used to typecast a C function that implements
 * a Ruby method so that it can be passed as an argument to API functions
 * like rb_define_method() and rb_define_singleton_method().
 *
 * VOIDFUNC(f) is a macro used to typecast a C function that implements
 * either the "mark" or "free" stuff for a Ruby Data object, so that it
 * can be passed as an argument to API functions like Data_Wrap_Struct()
 * and Data_Make_Struct().
 */
 
#ifdef __cplusplus
#  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
#    define PROTECTFUNC(f) ((VALUE (*)()) f)
#    define VALUEFUNC(f) ((VALUE (*)()) f)
#    define VOIDFUNC(f)  ((void (*)()) f)
#  else
#    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
#      define PROTECTFUNC(f) ((VALUE (*)()) f)
#      define VALUEFUNC(f) ((VALUE (*)()) f)
#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
#    else /* These definitions should work for Ruby 1.7+ */
#      define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
#      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
#    endif
#  endif
#else
#  define VALUEFUNC(f) (f)
#  define VOIDFUNC(f) (f)
#endif

/* Don't use for expressions have side effect */
#ifndef RB_STRING_VALUE
#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
#endif
#ifndef StringValue
#define StringValue(s) RB_STRING_VALUE(s)
#endif
#ifndef StringValuePtr
#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
#endif
#ifndef StringValueLen
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
#endif
#ifndef SafeStringValue
#define SafeStringValue(v) do {\
    StringValue(v);\
    rb_check_safe_str(v);\
} while (0)
#endif

#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
#endif

static VALUE _mSWIG = Qnil;

/* -----------------------------------------------------------------------------
 * error manipulation
 * ----------------------------------------------------------------------------- */


/* Define some additional error types */
#define SWIG_ObjectPreviouslyDeletedError  -100


/* Define custom exceptions for errors that do not map to existing Ruby
   exceptions.  Note this only works for C++ since a global cannot be
   initialized by a function in C.  For C, fallback to rb_eRuntimeError.*/

SWIGINTERN VALUE 
getNullReferenceError(void) {
  static int init = 0;
  static VALUE rb_eNullReferenceError ;
  if (!init) {
    init = 1;
    rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
  }
  return rb_eNullReferenceError;
} 

SWIGINTERN VALUE 
getObjectPreviouslyDeletedError(void) {
  static int init = 0;
  static VALUE rb_eObjectPreviouslyDeleted ;
  if (!init) {
    init = 1;
    rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
  }
  return rb_eObjectPreviouslyDeleted;
} 


SWIGINTERN VALUE
SWIG_Ruby_ErrorType(int SWIG_code) {
  VALUE type;
  switch (SWIG_code) {
  case SWIG_MemoryError:
    type = rb_eNoMemError;
    break;
  case SWIG_IOError:
    type = rb_eIOError;
    break;
  case SWIG_RuntimeError:
    type = rb_eRuntimeError;
    break;
  case SWIG_IndexError:
    type = rb_eIndexError;
    break;
  case SWIG_TypeError:
    type = rb_eTypeError;
    break;
  case SWIG_DivisionByZero:
    type = rb_eZeroDivError;
    break;
  case SWIG_OverflowError:
    type = rb_eRangeError;
    break;
  case SWIG_SyntaxError:
    type = rb_eSyntaxError;
    break;
  case SWIG_ValueError:
    type = rb_eArgError;
    break;
  case SWIG_SystemError:
    type = rb_eFatal;
    break;
  case SWIG_AttributeError:
    type = rb_eRuntimeError;
    break;
  case SWIG_NullReferenceError:
    type = getNullReferenceError();
    break;
  case SWIG_ObjectPreviouslyDeletedError:
    type = getObjectPreviouslyDeletedError();
    break;
  case SWIG_UnknownError:
    type = rb_eRuntimeError;
    break;
  default:
    type = rb_eRuntimeError;
  }
  return type;
}


/* This function is called when a user inputs a wrong argument to
   a method.
 */
SWIGINTERN 
const char* Ruby_Format_TypeError( const char* msg,
				   const char* type, 
				   const char* name, 
				   const int argn,
				   VALUE input )
{
  char buf[128];
  VALUE str;
  VALUE asStr;
  if ( msg && *msg )
    {
      str = rb_str_new2(msg);
    }
  else
    {
      str = rb_str_new(NULL, 0);
    }

  str = rb_str_cat2( str, "Expected argument " );
  sprintf( buf, "%d of type ", argn-1 );
  str = rb_str_cat2( str, buf );
  str = rb_str_cat2( str, type );
  str = rb_str_cat2( str, ", but got " );
  str = rb_str_cat2( str, rb_obj_classname(input) );
  str = rb_str_cat2( str, " " );
  asStr = rb_inspect(input);
  if ( RSTRING_LEN(asStr) > 30 )
    {
      str = rb_str_cat( str, StringValuePtr(asStr), 30 );
      str = rb_str_cat2( str, "..." );
    }
  else
    {
      str = rb_str_append( str, asStr );
    }

  if ( name )
    {
      str = rb_str_cat2( str, "\n\tin SWIG method '" );
      str = rb_str_cat2( str, name );
      str = rb_str_cat2( str, "'" );
    }

  return StringValuePtr( str );
}

/* This function is called when an overloaded method fails */
SWIGINTERN 
void Ruby_Format_OverloadedError(
				 const int argc,
				 const int maxargs,
				 const char* method, 
				 const char* prototypes 
				 )
{
  const char* msg = "Wrong # of arguments";
  if ( argc <= maxargs ) msg = "Wrong arguments";
  rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"  
	   "Possible C/C++ prototypes are:\n%s",
	   msg, method, prototypes);
}

/* -----------------------------------------------------------------------------
 * rubytracking.swg
 *
 * This file contains support for tracking mappings from 
 * Ruby objects to C++ objects.  This functionality is needed
 * to implement mark functions for Ruby's mark and sweep
 * garbage collector.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

#if !defined(ST_DATA_T_DEFINED)
/* Needs to be explicitly included for Ruby 1.8 and earlier */
#include <st.h>
#endif

/* Ruby 1.8 actually assumes the first case. */
#if SIZEOF_VOIDP == SIZEOF_LONG
#  define SWIG2NUM(v) LONG2NUM((unsigned long)v)
#  define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
#  define SWIG2NUM(v) LL2NUM((unsigned long long)v)
#  define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
#else
#  error sizeof(void*) is not the same as long or long long
#endif

/* Global hash table to store Trackings from C/C++
   structs to Ruby Objects. 
*/
static st_table* swig_ruby_trackings = NULL;

static VALUE swig_ruby_trackings_count(ANYARGS) {
  return SWIG2NUM(swig_ruby_trackings->num_entries);
}


/* Setup a hash table to store Trackings */
SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
  /* Create a hash table to store Trackings from C++
     objects to Ruby objects. */

  /* Try to see if some other .so has already created a 
     tracking hash table, which we keep hidden in an instance var
     in the SWIG module.
     This is done to allow multiple DSOs to share the same
     tracking table.
  */
  VALUE trackings_value = Qnil;
  /* change the variable name so that we can mix modules
     compiled with older SWIG's - this used to be called "@__trackings__" */
  ID trackings_id = rb_intern( "@__safetrackings__" );
  VALUE verbose = rb_gv_get("VERBOSE");
  rb_gv_set("VERBOSE", Qfalse);
  trackings_value = rb_ivar_get( _mSWIG, trackings_id );
  rb_gv_set("VERBOSE", verbose);

  /* The trick here is that we have to store the hash table
  pointer in a Ruby variable. We do not want Ruby's GC to
  treat this pointer as a Ruby object, so we convert it to
  a Ruby numeric value. */
  if (trackings_value == Qnil) {
    /* No, it hasn't.  Create one ourselves */
    swig_ruby_trackings = st_init_numtable();
    rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) );
  } else {
    swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
  }

#if RUBY_API_VERSION_CODE >= 20700
  rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, (rb_gvar_setter_t*)NULL);
#else
  rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, NULL);
#endif
}

/* Add a Tracking from a C/C++ struct to a Ruby object */
SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
  /* Store the mapping to the global hash table. */
  st_insert(swig_ruby_trackings, (st_data_t)ptr, object);
}

/* Get the Ruby object that owns the specified C/C++ struct */
SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
  /* Now lookup the value stored in the global hash table */
  VALUE value;

  if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) {
    return value;
  } else {
    return Qnil;
  }
}

/* Remove a Tracking from a C/C++ struct to a Ruby object.  It
   is very important to remove objects once they are destroyed
   since the same memory address may be reused later to create
   a new object. */
SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
  /* Delete the object from the hash table */
  st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL);
}

/* This is a helper method that unlinks a Ruby object from its
   underlying C++ object.  This is needed if the lifetime of the
   Ruby object is longer than the C++ object */
SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
  VALUE object = SWIG_RubyInstanceFor(ptr);

  if (object != Qnil) {
    if (TYPE(object) != T_DATA)
      abort();
    DATA_PTR(object) = 0;
  }
}

/* This is a helper method that iterates over all the trackings
   passing the C++ object pointer and its related Ruby object
   to the passed callback function. */

/* Proxy method to abstract the internal trackings datatype */
static int swig_ruby_internal_iterate_callback(void* ptr, VALUE obj, void(*meth)(void* ptr, VALUE obj)) {
  (*meth)(ptr, obj);
  return ST_CONTINUE;
}

SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
  st_foreach(swig_ruby_trackings, (int (*)(ANYARGS))&swig_ruby_internal_iterate_callback, (st_data_t)meth);
}

#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * Ruby API portion that goes into the runtime
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

SWIGINTERN VALUE
SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
  if (NIL_P(target)) {
    target = o;
  } else {
    if (TYPE(target) != T_ARRAY) {
      VALUE o2 = target;
      target = rb_ary_new();
      rb_ary_push(target, o2);
    }
    rb_ary_push(target, o);
  }
  return target;
}

/* For ruby1.8.4 and earlier. */
#ifndef RUBY_INIT_STACK
   RUBY_EXTERN void Init_stack(VALUE* addr);
#  define RUBY_INIT_STACK \
   VALUE variable_in_this_stack_frame; \
   Init_stack(&variable_in_this_stack_frame);
#endif


#ifdef __cplusplus
}
#endif


/* -----------------------------------------------------------------------------
 * rubyrun.swg
 *
 * This file contains the runtime support for Ruby modules
 * and includes code for managing global variables and pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* For backward compatibility only */
#define SWIG_POINTER_EXCEPTION  0

/* for raw pointers */
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Ruby_NewPointerObj(ptr, type, flags)
#define SWIG_AcquirePtr(ptr, own)                       SWIG_Ruby_AcquirePtr(ptr, own)
#define swig_owntype                                    swig_ruby_owntype

/* for raw packed data */
#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)

/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)

/* for C or C++ function pointers */
#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)

/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)


/* Runtime API */

#define SWIG_GetModule(clientdata)                      SWIG_Ruby_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) 		SWIG_Ruby_SetModule(pointer)


/* Error manipulation */

#define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
#define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
#define SWIG_fail                        		goto fail				 


/* Ruby-specific SWIG API */

#define SWIG_InitRuntime()                              SWIG_Ruby_InitRuntime()              
#define SWIG_define_class(ty)                        	SWIG_Ruby_define_class(ty)
#define SWIG_NewClassInstance(value, ty)             	SWIG_Ruby_NewClassInstance(value, ty)
#define SWIG_MangleStr(value)                        	SWIG_Ruby_MangleStr(value)		  
#define SWIG_CheckConvert(value, ty)                 	SWIG_Ruby_CheckConvert(value, ty)	  

#include "assert.h"

/* -----------------------------------------------------------------------------
 * pointers/data manipulation
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
  VALUE klass;
  VALUE mImpl;
  void  (*mark)(void *);
  void  (*destroy)(void *);
  int trackObjects;
} swig_class;


/* Global pointer used to keep some internal SWIG stuff */
static VALUE _cSWIG_Pointer = Qnil;
static VALUE swig_runtime_data_type_pointer = Qnil;

/* Global IDs used to keep some internal SWIG stuff */
static ID swig_arity_id = 0;
static ID swig_call_id  = 0;

/*
  If your swig extension is to be run within an embedded ruby and has
  director callbacks, you should set -DRUBY_EMBEDDED during compilation.  
  This will reset ruby's stack frame on each entry point from the main 
  program the first time a virtual director function is invoked (in a 
  non-recursive way).
  If this is not done, you run the risk of Ruby trashing the stack.
*/

#ifdef RUBY_EMBEDDED

#  define SWIG_INIT_STACK                            \
      if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
      ++swig_virtual_calls;
#  define SWIG_RELEASE_STACK --swig_virtual_calls;
#  define Ruby_DirectorTypeMismatchException(x) \
          rb_raise( rb_eTypeError, "%s", x ); return c_result;

      static unsigned int swig_virtual_calls = 0;

#else  /* normal non-embedded extension */

#  define SWIG_INIT_STACK
#  define SWIG_RELEASE_STACK
#  define Ruby_DirectorTypeMismatchException(x) \
          throw Swig::DirectorTypeMismatchException( x );

#endif  /* RUBY_EMBEDDED */


SWIGRUNTIME VALUE 
getExceptionClass(void) {
  static int init = 0;
  static VALUE rubyExceptionClass ;
  if (!init) {
    init = 1;
    rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
  }
  return rubyExceptionClass;
} 

/* This code checks to see if the Ruby object being raised as part
   of an exception inherits from the Ruby class Exception.  If so,
   the object is simply returned.  If not, then a new Ruby exception
   object is created and that will be returned to Ruby.*/
SWIGRUNTIME VALUE
SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
  VALUE exceptionClass = getExceptionClass();
  if (rb_obj_is_kind_of(obj, exceptionClass)) {
    return obj;
  }  else {
    return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
  }
}

/* Initialize Ruby runtime support */
SWIGRUNTIME void
SWIG_Ruby_InitRuntime(void)
{
  if (_mSWIG == Qnil) {
    _mSWIG = rb_define_module("SWIG");
    swig_call_id  = rb_intern("call");
    swig_arity_id = rb_intern("arity");
  }
}

/* Define Ruby class for C type */
SWIGRUNTIME void
SWIG_Ruby_define_class(swig_type_info *type)
{
  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
  sprintf(klass_name, "TYPE%s", type->name);
  if (NIL_P(_cSWIG_Pointer)) {
    _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
    rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
  }
  rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
  free((void *) klass_name);
}

/* Create a new pointer object */
SWIGRUNTIME VALUE
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
{
  int own =  flags & SWIG_POINTER_OWN; 
  int track;
  char *klass_name;
  swig_class *sklass;
  VALUE klass;
  VALUE obj;
  
  if (!ptr)
    return Qnil;
  
  if (type->clientdata) {
    sklass = (swig_class *) type->clientdata;
		
    /* Are we tracking this class and have we already returned this Ruby object? */
    track = sklass->trackObjects;
    if (track) {
      obj = SWIG_RubyInstanceFor(ptr);
      
      /* Check the object's type and make sure it has the correct type.
        It might not in cases where methods do things like 
        downcast methods. */
      if (obj != Qnil) {
        VALUE value = rb_iv_get(obj, "@__swigtype__");
        const char* type_name = RSTRING_PTR(value);
				
        if (strcmp(type->name, type_name) == 0) {
          return obj;
        }
      }
    }

    /* Create a new Ruby object */
    obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), 
			   ( own ? VOIDFUNC(sklass->destroy) : 
			     (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
			     ), ptr);

    /* If tracking is on for this class then track this object. */
    if (track) {
      SWIG_RubyAddTracking(ptr, obj);
    }
  } else {
    klass_name = (char *) malloc(4 + strlen(type->name) + 1);
    sprintf(klass_name, "TYPE%s", type->name);
    klass = rb_const_get(_mSWIG, rb_intern(klass_name));
    free((void *) klass_name);
    obj = Data_Wrap_Struct(klass, 0, 0, ptr);
  }
  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
  
  return obj;
}

/* Create a new class instance (always owned) */
SWIGRUNTIME VALUE
SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
{
  VALUE obj;
  swig_class *sklass = (swig_class *) type->clientdata;
  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
  return obj;
}

/* Get type mangle from class name */
SWIGRUNTIMEINLINE char *
SWIG_Ruby_MangleStr(VALUE obj)
{
  VALUE stype = rb_iv_get(obj, "@__swigtype__");
  return StringValuePtr(stype);
}

/* Acquire a pointer value */
typedef struct {
  void (*datafree)(void *);
  int own;
} swig_ruby_owntype;

SWIGRUNTIME swig_ruby_owntype
SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
  swig_ruby_owntype oldown = {0, 0};
  if (obj) {
    oldown.datafree = RDATA(obj)->dfree;
    RDATA(obj)->dfree = own.datafree;
  }
  return oldown;
}

/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own)
{
  char *c;
  swig_cast_info *tc;
  void *vptr = 0;

  /* Grab the pointer */
  if (NIL_P(obj)) {
    if (ptr)
      *ptr = 0;
    return SWIG_OK;
  } else {
    if (TYPE(obj) != T_DATA) {
      return SWIG_ERROR;
    }
    Data_Get_Struct(obj, void, vptr);
  }
  
  if (own) {
    own->datafree = RDATA(obj)->dfree;
    own->own = 0;
  }
    
  /* Check to see if the input object is giving up ownership
     of the underlying C struct or C++ object.  If so then we
     need to reset the destructor since the Ruby object no 
     longer owns the underlying C++ object.*/ 
  if (flags & SWIG_POINTER_DISOWN) {
    /* Is tracking on for this class? */
    int track = 0;
    if (ty && ty->clientdata) {
      swig_class *sklass = (swig_class *) ty->clientdata;
      track = sklass->trackObjects;
    }
		
    if (track) {
      /* We are tracking objects for this class.  Thus we change the destructor
       * to SWIG_RubyRemoveTracking.  This allows us to
       * remove the mapping from the C++ to Ruby object
       * when the Ruby object is garbage collected.  If we don't
       * do this, then it is possible we will return a reference 
       * to a Ruby object that no longer exists thereby crashing Ruby. */
      RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
    } else {    
      RDATA(obj)->dfree = 0;
    }
  }

  /* Do type-checking if type info was provided */
  if (ty) {
    if (ty->clientdata) {
      if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
        if (vptr == 0) {
          /* The object has already been deleted */
          return SWIG_ObjectPreviouslyDeletedError;
        }
      }
    }
    if ((c = SWIG_MangleStr(obj)) == NULL) {
      return SWIG_ERROR;
    }
    tc = SWIG_TypeCheck(c, ty);
    if (!tc) {
      return SWIG_ERROR;
    } else {
      if (ptr) {
        if (tc->type == ty) {
          *ptr = vptr;
        } else {
          int newmemory = 0;
          *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
          if (newmemory == SWIG_CAST_NEW_MEMORY) {
            assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
            if (own)
              own->own = own->own | SWIG_CAST_NEW_MEMORY;
          }
        }
      }
    }
  } else {
    if (ptr)
      *ptr = vptr;
  }
  
  return SWIG_OK;
}

/* Check convert */
SWIGRUNTIMEINLINE int
SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
{
  char *c = SWIG_MangleStr(obj);
  if (!c) return 0;
  return SWIG_TypeCheck(c,ty) != 0;
}

SWIGRUNTIME VALUE
SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
  char result[1024];
  char *r = result;
  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r, ptr, sz);
  strcpy(r, type->name);
  return rb_str_new2(result);
}

/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
  swig_cast_info *tc;
  const char  *c;

  if (TYPE(obj) != T_STRING) goto type_error;
  c = StringValuePtr(obj);
  /* Pointer values must start with leading underscore */
  if (*c != '_') goto type_error;
  c++;
  c = SWIG_UnpackData(c, ptr, sz);
  if (ty) {
    tc = SWIG_TypeCheck(c, ty);
    if (!tc) goto type_error;
  }
  return SWIG_OK;

 type_error:
  return SWIG_ERROR;
}

SWIGRUNTIME swig_module_info *
SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
{
  VALUE pointer;
  swig_module_info *ret = 0;
  VALUE verbose = rb_gv_get("VERBOSE");

 /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
  rb_gv_set("VERBOSE", Qfalse);
  
  /* first check if pointer already created */
  pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  if (pointer != Qnil) {
    Data_Get_Struct(pointer, swig_module_info, ret);
  }

  /* reinstate warnings */
  rb_gv_set("VERBOSE", verbose);
  return ret;
}

SWIGRUNTIME void 
SWIG_Ruby_SetModule(swig_module_info *pointer)
{
  /* register a new class */
  VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
  /* create and store the structure pointer to a global variable */
  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
}

/* This function can be used to check whether a proc or method or similarly
   callable function has been passed.  Usually used in a %typecheck, like:

   %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
        $result = SWIG_Ruby_isCallable( $input );
   }
 */
SWIGINTERN
int SWIG_Ruby_isCallable( VALUE proc )
{
  if ( rb_respond_to( proc, swig_call_id ) )
    return 1;
  return 0;
}

/* This function can be used to check the arity (number of arguments)
   a proc or method can take.  Usually used in a %typecheck.
   Valid arities will be that equal to minimal or those < 0
   which indicate a variable number of parameters at the end.
 */
SWIGINTERN
int SWIG_Ruby_arity( VALUE proc, int minimal )
{
  if ( rb_respond_to( proc, swig_arity_id ) )
    {
      VALUE num = rb_funcall( proc, swig_arity_id, 0 );
      int arity = NUM2INT(num);
      if ( arity < 0 && (arity+1) < -minimal ) return 1;
      if ( arity == minimal ) return 1;
      return 1;
    }
  return 0;
}


#ifdef __cplusplus
}
#endif



#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 

#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 



  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) 

/* -----------------------------------------------------------------------------
 * director_common.swg
 *
 * This file contains support for director classes which is common between
 * languages.
 * ----------------------------------------------------------------------------- */

/*
  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
  'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif
/* -----------------------------------------------------------------------------
 * director.swg
 *
 * This file contains support for director classes so that Ruby proxy
 * methods can be called from C++.
 * ----------------------------------------------------------------------------- */

/*
  Use -DSWIG_DIRECTOR_NOUEH if you prefer to avoid the use of the
  Undefined Exception Handler provided by swig.
*/
#ifndef SWIG_DIRECTOR_NOUEH
#ifndef SWIG_DIRECTOR_UEH
#define SWIG_DIRECTOR_UEH
#endif
#endif

#include <string>
#include <iostream>
#include <exception>
#include <map>

# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG)

namespace Swig {

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

    virtual swig_ruby_owntype get_own() const {
      swig_ruby_owntype own = {0, 0};
      return own;
    }
  };

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

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

    ~GCItem_var() {
      delete _item;
    }

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

  private:
    GCItem *_item;
  };


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

    virtual ~GCItem_T() {
      delete _ptr;
    }

  private:
    Type *_ptr;
  };

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

    virtual ~GCItem_Object() {
    }

    swig_ruby_owntype get_own() const {
      return _own;
    }

  private:
    swig_ruby_owntype _own;
  };

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

    virtual ~GCArray_T() {
      delete[] _ptr;
    }

  private:
    Type *_ptr;
  };


  /* body args */
  struct body_args {
    VALUE recv;
    ID id;
    int argc;
    VALUE *argv;
  };

  /* Base class for director exceptions */
  class DirectorException : public std::exception {
  protected:
    VALUE swig_error;
    std::string swig_msg;
  protected:
    DirectorException(VALUE error) : swig_error(error) {
    }

    DirectorException(VALUE error, const char *hdr, const char *msg ="") : swig_error(error), swig_msg(hdr) {
      if (msg[0]) {
	swig_msg += " ";
	swig_msg += msg;
      }
      if (swig_msg.size()) {
	VALUE str = rb_str_new(swig_msg.data(), swig_msg.size());
	swig_error = rb_exc_new3(error, str);
      } else {
	swig_error = error;
      }
    }

  public:
    virtual ~DirectorException() throw() {
    }

    VALUE getType() const {
      return CLASS_OF(swig_error);
    }

    VALUE getError() const {
      return swig_error;
    }

    /* Deprecated, use what() instead */
    const std::string& getMessage() const {
      return swig_msg;
    }

    const char *what() const throw() {
      return swig_msg.c_str();
    }
  };

  /* unknown exception handler  */
  class UnknownExceptionHandler {
#ifdef SWIG_DIRECTOR_UEH
    static void handler() {
      try {
	throw;
      } catch (DirectorException& e) {
	std::cerr << "SWIG Director exception caught:" << std::endl
		  << e.what() << std::endl;
      } catch (std::exception& e) {
	std::cerr << "std::exception caught: "<< e.what() << std::endl;
      } catch (...) {
	std::cerr << "Unknown exception caught." << std::endl;
      }
      std::cerr << std::endl
		<< "Ruby interpreter traceback:" << std::endl;
      std::cerr << std::endl;
      std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
		<< "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
		<< std::endl
		<< "Exception is being re-thrown, program will like abort/terminate." << std::endl;
      throw;
    }

  public:
    std::unexpected_handler old;
    UnknownExceptionHandler(std::unexpected_handler nh = handler) {
      old = std::set_unexpected(nh);
    }

    ~UnknownExceptionHandler() {
      std::set_unexpected(old);
    }
#endif
  };


  /* Type mismatch in the return value from a Ruby method call */
  class DirectorTypeMismatchException : public DirectorException {
  public:
    DirectorTypeMismatchException(VALUE error, const char *msg="")
      : DirectorException(error, "SWIG director type mismatch", msg) {
    }

    DirectorTypeMismatchException(const char *msg="")
      : DirectorException(rb_eTypeError, "SWIG director type mismatch", msg) {
    }

    static void raise(VALUE error, const char *msg) {
      throw DirectorTypeMismatchException(error, msg);
    }

    static void raise(const char *msg) {
      throw DirectorTypeMismatchException(msg);
    }
  };

  /* Any Ruby exception that occurs during a director method call */
  class DirectorMethodException : public DirectorException {
  public:
    DirectorMethodException(VALUE error)
      : DirectorException(error) {
    }

    DirectorMethodException(const char *msg = "")
      : DirectorException(rb_eRuntimeError, "SWIG director method error.", msg) {
    }

    static void raise(VALUE error) {
      throw DirectorMethodException(error);
    }
  };

  /* Attempted to call a pure virtual method via a director method */
  class DirectorPureVirtualException : public DirectorException
  {
  public:
    DirectorPureVirtualException(const char *msg = "")
      : DirectorException(rb_eRuntimeError, "SWIG director pure virtual method called", msg) {
    }

    static void raise(const char *msg) {
      throw DirectorPureVirtualException(msg);
    }
  };

  /* Simple thread abstraction for pthreads on win32 */
#ifdef __THREAD__
# define __PTHREAD__
# if defined(_WIN32) || defined(__WIN32__)
#  define pthread_mutex_lock EnterCriticalSection
#  define pthread_mutex_unlock LeaveCriticalSection
#  define pthread_mutex_t CRITICAL_SECTION
#  define SWIG_MUTEX_INIT(var) var
# else
#  include <pthread.h>
#  define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER
# endif
#endif

#ifdef  __PTHREAD__
  struct Guard {
    pthread_mutex_t *_mutex;

    Guard(pthread_mutex_t &mutex) : _mutex(&mutex) {
      pthread_mutex_lock(_mutex);
    }

    ~Guard() {
      pthread_mutex_unlock(_mutex);
    }
  };
# define SWIG_GUARD(mutex) Guard _guard(mutex)
#else
# define SWIG_GUARD(mutex)
#endif

  /* director base class */
  class Director {
  private:
    /* pointer to the wrapped Ruby object */
    VALUE swig_self;
    /* flag indicating whether the object is owned by Ruby or c++ */
    mutable bool swig_disown_flag;

  public:
    /* wrap a Ruby object. */
    Director(VALUE self) : swig_self(self), swig_disown_flag(false) {
    }

    /* discard our reference at destruction */
    virtual ~Director() {
    }

    /* return a pointer to the wrapped Ruby object */
    VALUE swig_get_self() const {
      return swig_self;
    }

    /* acquire ownership of the wrapped Ruby object (the sense of "disown" is from Ruby) */
    void swig_disown() const {
      if (!swig_disown_flag) {
        swig_disown_flag = true;
      }
    }

  /* ownership management */
  private:
    typedef std::map<void *, GCItem_var> swig_ownership_map;
    mutable swig_ownership_map swig_owner;
#ifdef __PTHREAD__
    static pthread_mutex_t swig_mutex_own;
#endif

  public:
    template <typename Type>
    void swig_acquire_ownership_array(Type *vptr) const {
      if (vptr) {
	SWIG_GUARD(swig_mutex_own);
	swig_owner[vptr] = new GCArray_T<Type>(vptr);
      }
    }

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

    void swig_acquire_ownership_obj(void *vptr, swig_ruby_owntype own) const {
      if (vptr && own.datafree) {
	SWIG_GUARD(swig_mutex_own);
	swig_owner[vptr] = new GCItem_Object(own);
      }
    }

    swig_ruby_owntype swig_release_ownership(void *vptr) const {
      swig_ruby_owntype own = {0, 0};
      if (vptr) {
	SWIG_GUARD(swig_mutex_own);
	swig_ownership_map::iterator iter = swig_owner.find(vptr);
	if (iter != swig_owner.end()) {
	  own.datafree = iter->second->get_own().datafree;
	  swig_owner.erase(iter);
	}
      }
      return own;
    }
  };
}


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

#define SWIGTYPE_p_Xapian__BB2Weight swig_types[0]
#define SWIGTYPE_p_Xapian__BM25PlusWeight swig_types[1]
#define SWIGTYPE_p_Xapian__BM25Weight swig_types[2]
#define SWIGTYPE_p_Xapian__BoolWeight swig_types[3]
#define SWIGTYPE_p_Xapian__Compactor swig_types[4]
#define SWIGTYPE_p_Xapian__CoordWeight swig_types[5]
#define SWIGTYPE_p_Xapian__DLHWeight swig_types[6]
#define SWIGTYPE_p_Xapian__DPHWeight swig_types[7]
#define SWIGTYPE_p_Xapian__Database swig_types[8]
#define SWIGTYPE_p_Xapian__DateRangeProcessor swig_types[9]
#define SWIGTYPE_p_Xapian__DateValueRangeProcessor swig_types[10]
#define SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource swig_types[11]
#define SWIGTYPE_p_Xapian__Document swig_types[12]
#define SWIGTYPE_p_Xapian__ESet swig_types[13]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[14]
#define SWIGTYPE_p_Xapian__Enquire swig_types[15]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[16]
#define SWIGTYPE_p_Xapian__ExpandDeciderAnd swig_types[17]
#define SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix swig_types[18]
#define SWIGTYPE_p_Xapian__ExpandDeciderFilterTerms swig_types[19]
#define SWIGTYPE_p_Xapian__FieldProcessor swig_types[20]
#define SWIGTYPE_p_Xapian__FixedWeightPostingSource swig_types[21]
#define SWIGTYPE_p_Xapian__GreatCircleMetric swig_types[22]
#define SWIGTYPE_p_Xapian__IfB2Weight swig_types[23]
#define SWIGTYPE_p_Xapian__InL2Weight swig_types[24]
#define SWIGTYPE_p_Xapian__IneB2Weight swig_types[25]
#define SWIGTYPE_p_Xapian__KeyMaker swig_types[26]
#define SWIGTYPE_p_Xapian__LMWeight swig_types[27]
#define SWIGTYPE_p_Xapian__LatLongCoord swig_types[28]
#define SWIGTYPE_p_Xapian__LatLongCoords swig_types[29]
#define SWIGTYPE_p_Xapian__LatLongCoordsIterator swig_types[30]
#define SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker swig_types[31]
#define SWIGTYPE_p_Xapian__LatLongDistancePostingSource swig_types[32]
#define SWIGTYPE_p_Xapian__LatLongMetric swig_types[33]
#define SWIGTYPE_p_Xapian__MSet swig_types[34]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[35]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[36]
#define SWIGTYPE_p_Xapian__MatchSpy swig_types[37]
#define SWIGTYPE_p_Xapian__MultiValueKeyMaker swig_types[38]
#define SWIGTYPE_p_Xapian__NumberRangeProcessor swig_types[39]
#define SWIGTYPE_p_Xapian__NumberValueRangeProcessor swig_types[40]
#define SWIGTYPE_p_Xapian__PL2PlusWeight swig_types[41]
#define SWIGTYPE_p_Xapian__PL2Weight swig_types[42]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[43]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[44]
#define SWIGTYPE_p_Xapian__PostingSource swig_types[45]
#define SWIGTYPE_p_Xapian__Query swig_types[46]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[47]
#define SWIGTYPE_p_Xapian__RSet swig_types[48]
#define SWIGTYPE_p_Xapian__RangeProcessor swig_types[49]
#define SWIGTYPE_p_Xapian__Registry swig_types[50]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[51]
#define SWIGTYPE_p_Xapian__Stem swig_types[52]
#define SWIGTYPE_p_Xapian__StemImplementation swig_types[53]
#define SWIGTYPE_p_Xapian__Stopper swig_types[54]
#define SWIGTYPE_p_Xapian__StringValueRangeProcessor swig_types[55]
#define SWIGTYPE_p_Xapian__TermGenerator swig_types[56]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[57]
#define SWIGTYPE_p_Xapian__TfIdfWeight swig_types[58]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[59]
#define SWIGTYPE_p_Xapian__ValueCountMatchSpy swig_types[60]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[61]
#define SWIGTYPE_p_Xapian__ValueMapPostingSource swig_types[62]
#define SWIGTYPE_p_Xapian__ValuePostingSource swig_types[63]
#define SWIGTYPE_p_Xapian__ValueRangeProcessor swig_types[64]
#define SWIGTYPE_p_Xapian__ValueSetMatchDecider swig_types[65]
#define SWIGTYPE_p_Xapian__ValueWeightPostingSource swig_types[66]
#define SWIGTYPE_p_Xapian__Weight swig_types[67]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[68]
#define SWIGTYPE_p_char swig_types[69]
#define SWIGTYPE_p_compaction_level swig_types[70]
#define SWIGTYPE_p_docid_order swig_types[71]
#define SWIGTYPE_p_double swig_types[72]
#define SWIGTYPE_p_feature_flag swig_types[73]
#define SWIGTYPE_p_flags swig_types[74]
#define SWIGTYPE_p_int swig_types[75]
#define SWIGTYPE_p_std__string swig_types[76]
#define SWIGTYPE_p_stem_strategy swig_types[77]
#define SWIGTYPE_p_stop_strategy swig_types[78]
#define SWIGTYPE_p_swig__ConstIterator swig_types[79]
#define SWIGTYPE_p_swig__GC_VALUE swig_types[80]
#define SWIGTYPE_p_swig__Iterator swig_types[81]
#define SWIGTYPE_p_type_smoothing swig_types[82]
#define SWIGTYPE_p_unsigned_int swig_types[83]
#define SWIGTYPE_p_unsigned_long swig_types[84]
#define SWIGTYPE_p_void swig_types[85]
static swig_type_info *swig_types[87];
static swig_module_info swig_module = {swig_types, 86, 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) -------- */

#define SWIG_init    Init__xapian
#define SWIG_name    "Xapian"

static VALUE mXapian;

#define SWIG_RUBY_THREAD_BEGIN_BLOCK
#define SWIG_RUBY_THREAD_END_BLOCK


#define SWIGVERSION 0x030013 
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 


#include <stdexcept>


/* ruby.i: SWIG interface file for the Ruby bindings
 *
 * Original version by Paul Legato (plegato@nks.net), 4/17/06.
 * Based on the php4 and python util.i files.
 *
 * Copyright (C) 2006 Networked Knowledge Systems, Inc.
 * Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2019 Olly Betts
 * Copyright (C) 2010 Richard Boulton
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */



/** @file
 * @brief Header for SWIG interface file for Xapian.
 */
/* Copyright (C) 2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016 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 <fstream>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

// If a backend has been disabled in xapian-core (manually or automatically) we
// include a stub definition here so the bindings can still be built.
namespace Xapian {



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

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




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

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

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

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

}


#include <typeinfo>
#include <stdexcept>


namespace swig {
  class SwigGCReferences {
    VALUE _hash;

    SwigGCReferences() : _hash(Qnil) {
    }
    ~SwigGCReferences() {
      if (_hash != Qnil)
        rb_gc_unregister_address(&_hash);
    }
    static void EndProcHandler(VALUE) {
      // Ruby interpreter ending - _hash can no longer be accessed.
      SwigGCReferences &s_references = instance();
      s_references._hash = Qnil;
    }
  public:
    static SwigGCReferences& instance() {
      // Hash of all GC_VALUE's currently in use
      static SwigGCReferences s_references;

      return s_references;
    }
    static void initialize() {
      SwigGCReferences &s_references = instance();
      if (s_references._hash == Qnil) {
        rb_set_end_proc(&EndProcHandler, Qnil);
        s_references._hash = rb_hash_new();
        rb_gc_register_address(&s_references._hash);
      }
    }
    void GC_register(VALUE& obj) {
      if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj))
        return;
      if (_hash != Qnil) {
        VALUE val = rb_hash_aref(_hash, obj);
        unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 0;
        ++n;
        rb_hash_aset(_hash, obj, INT2NUM(n));
      }
    }
    void GC_unregister(const VALUE& obj) {
      if (FIXNUM_P(obj) || SPECIAL_CONST_P(obj) || SYMBOL_P(obj))
        return;
      // this test should not be needed but I've noticed some very erratic
      // behavior of none being unregistered in some very rare situations.
      if (BUILTIN_TYPE(obj) == T_NONE)
        return;
      if (_hash != Qnil) {
        VALUE val = rb_hash_aref(_hash, obj);
        unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 1;
        --n;
        if (n)
          rb_hash_aset(_hash, obj, INT2NUM(n));
        else
          rb_hash_delete(_hash, obj);
      }
    }
  };

  class GC_VALUE {
  protected:
    VALUE  _obj;

    static ID hash_id;
    static ID   lt_id;
    static ID   gt_id;
    static ID   eq_id;
    static ID   le_id;
    static ID   ge_id;

    static ID  pos_id;
    static ID  neg_id;
    static ID  inv_id;

    static ID  add_id;
    static ID  sub_id;
    static ID  mul_id;
    static ID  div_id;
    static ID  mod_id;

    static ID  and_id;
    static ID   or_id;
    static ID  xor_id;

    static ID  lshift_id;
    static ID  rshift_id;

    struct OpArgs
    {
      VALUE src;
      ID    id;
      int   nargs;
      VALUE target;
    };


  public:
    GC_VALUE() : _obj(Qnil)
    {
    }

    GC_VALUE(const GC_VALUE& item) : _obj(item._obj)
    {
      SwigGCReferences::instance().GC_register(_obj);
    }
    
    GC_VALUE(VALUE obj) :_obj(obj)
    {
      SwigGCReferences::instance().GC_register(_obj);
    }
    
    ~GC_VALUE() 
    {
      SwigGCReferences::instance().GC_unregister(_obj);
    }
    
    GC_VALUE & operator=(const GC_VALUE& item) 
    {
      SwigGCReferences::instance().GC_unregister(_obj);
      _obj = item._obj;
      SwigGCReferences::instance().GC_register(_obj);
      return *this;
    }

    operator VALUE() const
    {
      return _obj;
    }

    VALUE inspect() const
    {
      return rb_inspect(_obj);
    }

    VALUE to_s() const
    {
      return rb_inspect(_obj);
    }

    static VALUE swig_rescue_swallow(VALUE)
    {
      /*
      VALUE errstr = rb_obj_as_string(rb_errinfo());
      printf("Swallowing error: '%s'\n", RSTRING_PTR(StringValue(errstr)));
      */
      return Qnil; /* Swallow Ruby exception */
    }

    static VALUE swig_rescue_funcall(VALUE p)
    {
      OpArgs* args = (OpArgs*) p;
      return rb_funcall(args->src, args->id, args->nargs, args->target);
    }

    bool relational_equal_op(const GC_VALUE& other, const ID& op_id, bool (*op_func)(const VALUE& a, const VALUE& b)) const
    {
      if (FIXNUM_P(_obj) && FIXNUM_P(other._obj)) {
        return op_func(_obj, other._obj);
      }
      bool res = false;
      VALUE ret = Qnil;
      SWIG_RUBY_THREAD_BEGIN_BLOCK;
      if (rb_respond_to(_obj, op_id)) {
        OpArgs  args;
        args.src    = _obj;
        args.id     = op_id;
        args.nargs  = 1;
        args.target = VALUE(other);
        ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
                       (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
      }
      if (ret == Qnil) {
        VALUE a = rb_funcall(         _obj, hash_id, 0 );
        VALUE b = rb_funcall( VALUE(other), hash_id, 0 );
        res = op_func(a, b);
      } else {
        res = RTEST(ret);
      }
      SWIG_RUBY_THREAD_END_BLOCK;
      return res;
    }

    static bool operator_eq(const VALUE& a, const VALUE& b) { return a == b; }
    static bool operator_lt(const VALUE& a, const VALUE& b) { return a < b; }
    static bool operator_le(const VALUE& a, const VALUE& b) { return a <= b; }
    static bool operator_gt(const VALUE& a, const VALUE& b) { return a > b; }
    static bool operator_ge(const VALUE& a, const VALUE& b) { return a >= b; }

    bool operator==(const GC_VALUE& other) const { return relational_equal_op(other, eq_id, operator_eq); }
    bool operator<(const GC_VALUE& other) const { return relational_equal_op(other, lt_id, operator_lt); }
    bool operator<=(const GC_VALUE& other) const { return relational_equal_op(other, le_id, operator_le); }
    bool operator>(const GC_VALUE& other) const { return relational_equal_op(other, gt_id, operator_gt); }
    bool operator>=(const GC_VALUE& other) const { return relational_equal_op(other, ge_id, operator_ge); }

    bool operator!=(const GC_VALUE& other) const
    {
      return !(this->operator==(other));
    }

    GC_VALUE unary_op(const ID& op_id) const
    {
      VALUE ret = Qnil;
      SWIG_RUBY_THREAD_BEGIN_BLOCK;
      OpArgs  args;
      args.src    = _obj;
      args.id     = op_id;
      args.nargs  = 0;
      args.target = Qnil;
      ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
                     (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
      SWIG_RUBY_THREAD_END_BLOCK;
      return ret;
    }

    GC_VALUE operator+() const { return unary_op(pos_id); }
    GC_VALUE operator-() const { return unary_op(neg_id); }
    GC_VALUE operator~() const { return unary_op(inv_id); }

    GC_VALUE binary_op(const GC_VALUE& other, const ID& op_id) const
    {
      VALUE ret = Qnil;
      SWIG_RUBY_THREAD_BEGIN_BLOCK;
      OpArgs  args;
      args.src    = _obj;
      args.id     = op_id;
      args.nargs  = 1;
      args.target = VALUE(other);
      ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
                     (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
      SWIG_RUBY_THREAD_END_BLOCK;
      return GC_VALUE(ret);
    }

    GC_VALUE operator+(const GC_VALUE& other) const { return binary_op(other, add_id); }
    GC_VALUE operator-(const GC_VALUE& other) const { return binary_op(other, sub_id); }
    GC_VALUE operator*(const GC_VALUE& other) const { return binary_op(other, mul_id); }
    GC_VALUE operator/(const GC_VALUE& other) const { return binary_op(other, div_id); }
    GC_VALUE operator%(const GC_VALUE& other) const { return binary_op(other, mod_id); }
    GC_VALUE operator&(const GC_VALUE& other) const { return binary_op(other, and_id); }
    GC_VALUE operator^(const GC_VALUE& other) const { return binary_op(other, xor_id); }
    GC_VALUE operator|(const GC_VALUE& other) const { return binary_op(other, or_id); }
    GC_VALUE operator<<(const GC_VALUE& other) const { return binary_op(other, lshift_id); }
    GC_VALUE operator>>(const GC_VALUE& other) const { return binary_op(other, rshift_id); }
  };

  ID  GC_VALUE::hash_id = rb_intern("hash");
  ID  GC_VALUE::lt_id = rb_intern("<");
  ID  GC_VALUE::gt_id = rb_intern(">");
  ID  GC_VALUE::eq_id = rb_intern("==");
  ID  GC_VALUE::le_id = rb_intern("<=");
  ID  GC_VALUE::ge_id = rb_intern(">=");

  ID  GC_VALUE::pos_id = rb_intern("+@");
  ID  GC_VALUE::neg_id = rb_intern("-@");
  ID  GC_VALUE::inv_id = rb_intern("~");

  ID  GC_VALUE::add_id = rb_intern("+");
  ID  GC_VALUE::sub_id = rb_intern("-");
  ID  GC_VALUE::mul_id = rb_intern("*");
  ID  GC_VALUE::div_id = rb_intern("/");
  ID  GC_VALUE::mod_id = rb_intern("%");

  ID  GC_VALUE::and_id = rb_intern("&");
  ID  GC_VALUE::or_id  = rb_intern("|");
  ID  GC_VALUE::xor_id = rb_intern("^");

  ID  GC_VALUE::lshift_id = rb_intern("<<");
  ID  GC_VALUE::rshift_id = rb_intern(">>");

  typedef GC_VALUE LANGUAGE_OBJ;

} // namespace swig



#if defined(__GNUC__)
#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
#     define SWIG_STD_NOMODERN_STL
#  endif
#endif


#include <string>


#include <stddef.h>


#include <iostream>


namespace swig {
  struct stop_iteration {
  };

  /** 
   * Abstract base class used to represent all iterators of STL containers.
   */
  struct ConstIterator {
  public:
    typedef ConstIterator self_type;

  protected:
    GC_VALUE _seq;

  protected:
    ConstIterator(VALUE seq) : _seq(seq)
    {
    }

    // Random access iterator methods, but not required in Ruby
    virtual ptrdiff_t distance(const ConstIterator &x) const
    {
      throw std::invalid_argument("distance not supported");
    }

    virtual bool equal (const ConstIterator &x) const
    {
      throw std::invalid_argument("equal not supported");
    }

    virtual self_type* advance(ptrdiff_t n)
    {
      throw std::invalid_argument("advance not supported");
    }
      
  public:
    virtual ~ConstIterator() {}

    // Access iterator method, required by Ruby
    virtual VALUE value() const {
      throw std::invalid_argument("value not supported");
      return Qnil;
    };

    virtual VALUE setValue( const VALUE& v ) {
      throw std::invalid_argument("value= not supported");
      return Qnil;
    }

    virtual self_type* next( size_t n = 1 )
    {
      return this->advance( n );
    }

    virtual self_type* previous( size_t n = 1 )
    {
      ptrdiff_t nn = n;
      return this->advance( -nn );
    }

    virtual VALUE to_s() const {
      throw std::invalid_argument("to_s not supported");
      return Qnil;
    }

    virtual VALUE inspect() const {
      throw std::invalid_argument("inspect not supported");
      return Qnil;
    }
    
    virtual ConstIterator *dup() const
    {
      throw std::invalid_argument("dup not supported");
      return NULL;
    }

    //
    // C++ common/needed methods.  We emulate a bidirectional
    // operator, to be compatible with all the STL.
    // The iterator traits will then tell the STL what type of
    // iterator we really are.
    //
    ConstIterator() : _seq( Qnil )
    {
    }

    ConstIterator( const self_type& b ) : _seq( b._seq )
    {
    }

    self_type& operator=( const self_type& b )
    {
      _seq = b._seq;
      return *this;
    }

    bool operator == (const ConstIterator& x)  const
    {
      return equal(x);
    }
      
    bool operator != (const ConstIterator& x) const
    {
      return ! operator==(x);
    }
      
    // Pre-decrement operator
    self_type& operator--()
    {
      return *previous();
    }

    // Pre-increment operator
    self_type& operator++()
    {
      return *next();
    }

    // Post-decrement operator
    self_type operator--(int)
    {
      self_type r = *this;
      previous();
      return r;
    }

    // Post-increment operator
    self_type operator++(int)
    {
      self_type r = *this;
      next();
      return r;
    }

    ConstIterator& operator += (ptrdiff_t n)
    {
      return *advance(n);
    }

    ConstIterator& operator -= (ptrdiff_t n)
    {
      return *advance(-n);
    }

    ConstIterator* operator + (ptrdiff_t n) const
    {
      return dup()->advance(n);
    }

    ConstIterator* operator - (ptrdiff_t n) const
    {
      return dup()->advance(-n);
    }
      
    ptrdiff_t operator - (const ConstIterator& x) const
    {
      return x.distance(*this);
    }
      
    static swig_type_info* descriptor() {
      static int init = 0;
      static swig_type_info* desc = 0;
      if (!init) {
	desc = SWIG_TypeQuery("swig::ConstIterator *");
	init = 1;
      }	
      return desc;
    }
  };


  /**
   * Abstract base class used to represent all non-const iterators of STL containers.
   * 
   */
  struct Iterator : public ConstIterator {
  public:
    typedef Iterator self_type;

  protected:
    Iterator(VALUE seq) : ConstIterator(seq)
    {
    }

    virtual self_type* advance(ptrdiff_t n)
    {
      throw std::invalid_argument("operation not supported");
    }

  public:
    static swig_type_info* descriptor() {
      static int init = 0;
      static swig_type_info* desc = 0;
      if (!init) {
	desc = SWIG_TypeQuery("swig::Iterator *");
	init = 1;
      }	
      return desc;
    }
    
    virtual Iterator *dup() const
    {
      throw std::invalid_argument("dup not supported");
      return NULL;
    }
      
    virtual self_type* next( size_t n = 1 )
    {
      return this->advance( n );
    }

    virtual self_type* previous( size_t n = 1 )
    {
      ptrdiff_t nn = n;
      return this->advance( -nn );
    }

    bool operator == (const ConstIterator& x)  const
    {
      return equal(x);
    }
      
    bool operator != (const Iterator& x) const
    {
      return ! operator==(x);
    }
      
    Iterator& operator += (ptrdiff_t n)
    {
      return *advance(n);
    }

    Iterator& operator -= (ptrdiff_t n)
    {
      return *advance(-n);
    }
      
    Iterator* operator + (ptrdiff_t n) const
    {
      return dup()->advance(n);
    }

    Iterator* operator - (ptrdiff_t n) const
    {
      return dup()->advance(-n);
    }
      
    ptrdiff_t operator - (const Iterator& x) const
    {
      return x.distance(*this);
    }
  };

}


SWIGINTERN VALUE
SWIG_ruby_failed(void)
{
  return Qnil;
} 


/*@SWIG:/home/olly/git/xapian-1.4/TMP.make_dist.s3p9tdl3vS/swig/Lib/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
{
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  unsigned long *res = (unsigned long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
  return obj;
}
/*@SWIG@*/

SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val) 
{
  VALUE type = TYPE(obj);
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
    unsigned long v;
    VALUE a[2];
    a[0] = obj;
    a[1] = (VALUE)(&v);
    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
      if (val) *val = v;
      return SWIG_OK;
    }
  }
  return SWIG_TypeError;
}


#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
#   define LLONG_MAX __LONG_LONG_MAX__
#   define LLONG_MIN (-LLONG_MAX - 1LL)
#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif


#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
#  define SWIG_LONG_LONG_AVAILABLE
#endif


#ifdef SWIG_LONG_LONG_AVAILABLE
/*@SWIG:/home/olly/git/xapian-1.4/TMP.make_dist.s3p9tdl3vS/swig/Lib/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE *args)
{
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  long long *res = (long long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj);
  return obj;
}
/*@SWIG@*/

SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_long (VALUE obj, unsigned long long *val)
{ 
  VALUE type = TYPE(obj);
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
    unsigned long long v;
    VALUE a[2];
    a[0] = obj;
    a[1] = (VALUE)(&v);
    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
      if (val) *val = v;
      return SWIG_OK;
    }
  }
  return SWIG_TypeError;
}
#endif


SWIGINTERNINLINE int
SWIG_AsVal_size_t (VALUE obj, size_t *val)
{
  int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
    unsigned long v;
    res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
    unsigned long long v;
    res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
  }
#endif
  return res;
}


SWIGINTERNINLINE VALUE
SWIG_From_bool  (bool value)
{
  return value ? Qtrue : Qfalse;
}


/*@SWIG:/home/olly/git/xapian-1.4/TMP.make_dist.s3p9tdl3vS/swig/Lib/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
{
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  long *res = (long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
  return obj;
}
/*@SWIG@*/

SWIGINTERN int
SWIG_AsVal_long (VALUE obj, long* val)
{
  VALUE type = TYPE(obj);
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
    long v;
    VALUE a[2];
    a[0] = obj;
    a[1] = (VALUE)(&v);
    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
      if (val) *val = v;
      return SWIG_OK;
    }
  }
  return SWIG_TypeError;
}


#ifdef SWIG_LONG_LONG_AVAILABLE
/*@SWIG:/home/olly/git/xapian-1.4/TMP.make_dist.s3p9tdl3vS/swig/Lib/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE *args)
{
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  long long *res = (long long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2LL(obj) : rb_big2ll(obj);
  return obj;
}
/*@SWIG@*/

SWIGINTERN int
SWIG_AsVal_long_SS_long (VALUE obj, long long *val)
{
  VALUE type = TYPE(obj);
  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
    long long v;
    VALUE a[2];
    a[0] = obj;
    a[1] = (VALUE)(&v);
    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
      if (val) *val = v;
      return SWIG_OK;
    }
  }
  return SWIG_TypeError;
}
#endif


SWIGINTERNINLINE int
SWIG_AsVal_ptrdiff_t (VALUE obj, ptrdiff_t *val)
{
  int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
    long v;
    res = SWIG_AsVal_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
    long long v;
    res = SWIG_AsVal_long_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
  }
#endif
  return res;
}


  #define SWIG_From_long   LONG2NUM 


#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE VALUE 
SWIG_From_long_SS_long  (long long value)
{
  return LL2NUM(value);
}
#endif


SWIGINTERNINLINE VALUE
SWIG_From_ptrdiff_t  (ptrdiff_t value)
{    
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
    return SWIG_From_long  (static_cast< long >(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else {
    /* assume sizeof(ptrdiff_t) <= sizeof(long long) */
    return SWIG_From_long_SS_long  (static_cast< long long >(value));
  }
#endif
}


#include <algorithm>


#include <vector>


#include <utility>


#include <map>


#include <algorithm>


class XapianSWIGQueryItor {
    VALUE array;

    int i;

  public:
    typedef std::random_access_iterator_tag iterator_category;
    typedef Xapian::Query value_type;
    typedef Xapian::termcount_diff difference_type;
    typedef Xapian::Query * pointer;
    typedef Xapian::Query & reference;

    XapianSWIGQueryItor() { }

    void begin(VALUE array_) {
	array = array_;
	i = 0;
    }

    void end(int n) {
	i = n;
    }

    XapianSWIGQueryItor & operator++() {
	++i;
	return *this;
    }

    Xapian::Query operator*() const {
	VALUE entry = rb_ary_entry(array, i);
	if (TYPE(entry) == T_STRING) {
	    return Xapian::Query(string(RSTRING_PTR(entry),
					RSTRING_LEN(entry)));
	}

	// array element may be a Xapian::Query object. Add it if it is,
	// otherwise error out.
	Xapian::Query *subq = 0;
	if (SWIG_ConvertPtr(entry, (void **)&subq,
			    SWIGTYPE_p_Xapian__Query, 0) < 0 || !subq) {
	    SWIG_exception(SWIG_ValueError, "Elements of Arrays passed to Query must be either Strings or other Query objects");
	    return Xapian::Query();
	}
	return *subq;
    }

    bool operator==(const XapianSWIGQueryItor & o) {
	return i == o.i;
    }

    bool operator!=(const XapianSWIGQueryItor & o) {
	return !(*this == o);
    }

    difference_type operator-(const XapianSWIGQueryItor &o) const {
	return i - o.i;
    }
};



/** @file
 * @brief Language independent exception handling.
 */
/* Warning: This file is generated by ./generic/generate-generic-exceptions
 * - do not modify directly!
 *
 * Copyright (C) 2004,2005,2006,2007,2011,2012,2018 Olly Betts
 * Copyright (C) 2007 Lemur Consulting Ltd
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

/* This file is included for any languages which don't have language specific
 * handling for exceptions.
 */

#include <exception>

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_description();
	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::InvalidArgumentError &) {
	    return SWIG_ValueError;
	} catch (const Xapian::RangeError &) {
	    return SWIG_IndexError;
	} catch (const Xapian::DatabaseError &) {
	    return SWIG_IOError;
	} catch (const Xapian::NetworkError &) {
	    return SWIG_IOError;
	} catch (const Xapian::InternalError &) {
	    return SWIG_RuntimeError;
	} catch (const Xapian::RuntimeError &) {
	    return SWIG_RuntimeError;
	} catch (...) {
	    return SWIG_UnknownError;
	}
    } catch (const std::exception &e) {
	msg = "std::exception: ";
        msg += e.what();
    } catch (...) {
	msg = "unknown error in Xapian";
    }
    return SWIG_UnknownError;
}


/* xapian-headers.i: Getting SWIG to parse Xapian's C++ headers.
 *
 * Copyright 2004,2006,2011,2012,2013,2014,2015,2016,2019,2020 Olly Betts
 * Copyright 2014 Assem Chelli
 *
 * 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
 */


SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
  static int init = 0;
  static swig_type_info* info = 0;
  if (!init) {
    info = SWIG_TypeQuery("_p_char");
    init = 1;
  }
  return info;
}


SWIGINTERNINLINE VALUE 
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
  if (carray) {
    if (size > LONG_MAX) {
      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
      return pchar_descriptor ? 
	SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
    } else {
      return rb_str_new(carray, static_cast< long >(size));
    }
  } else {
    return Qnil;
  }
}


SWIGINTERNINLINE VALUE 
SWIG_FromCharPtr(const char *cptr)
{ 
  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}


SWIGINTERNINLINE VALUE
SWIG_From_int  (int value)
{    
  return SWIG_From_long  (value);
}


SWIGINTERNINLINE VALUE
SWIG_From_unsigned_SS_long  (unsigned long value)
{
  return ULONG2NUM(value); 
}


SWIGINTERNINLINE VALUE
SWIG_From_unsigned_SS_int  (unsigned int value)
{    
  return SWIG_From_unsigned_SS_long  (value);
}


SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
{
  unsigned long v;
  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v > UINT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = static_cast< unsigned int >(v);
    }
  }  
  return res;
}


SWIGINTERNINLINE VALUE
SWIG_From_std_string  (const std::string& s)
{
  return SWIG_FromCharPtrAndSize(s.data(), s.size());
}

SWIGINTERN bool Xapian_PositionIterator_equals(Xapian::PositionIterator const *self,Xapian::PositionIterator const &o){ return *self == o; }
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_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &o){ return *self == o; }
SWIGINTERN Xapian::docid Xapian_PostingIterator_get_docid(Xapian::PostingIterator const *self){ return **self; }
SWIGINTERN void Xapian_PostingIterator_next(Xapian::PostingIterator *self){ ++(*self); }

SWIGINTERN int
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
{
  if (TYPE(obj) == T_STRING) {
    char *cstr = StringValuePtr(obj); 
    size_t size = RSTRING_LEN(obj) + 1;
    if (cptr)  {
      if (alloc) {
	if (*alloc == SWIG_NEWOBJ) {
	  *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
	} else {
	  *cptr = cstr;
	  *alloc = SWIG_OLDOBJ;
	}
      }
    }
    if (psize) *psize = size;
    return SWIG_OK;
  } else {
    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    if (pchar_descriptor) {
      void* vptr = 0;
      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
	if (cptr) *cptr = (char *)vptr;
	if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
	if (alloc) *alloc = SWIG_OLDOBJ;
	return SWIG_OK;
      }
    }
  }  
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsPtr_std_string (VALUE obj, std::string **val) 
{
  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
    if (buf) {
      if (val) *val = new std::string(buf, size - 1);
      if (alloc == SWIG_NEWOBJ) delete[] buf;
      return SWIG_NEWOBJ;
    } else {
      if (val) *val = 0;
      return SWIG_OLDOBJ;
    }
  } else {
    static int init = 0;
    static swig_type_info* descriptor = 0;
    if (!init) {
      descriptor = SWIG_TypeQuery("std::string" " *");
      init = 1;
    }
    if (descriptor) {
      std::string *vptr;
      int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
      if (SWIG_IsOK(res) && val) *val = vptr;
      return res;
    }
  }
  return SWIG_ERROR;
}

SWIGINTERN bool Xapian_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &o){ return *self == o; }
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_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &o){ return *self == o; }
SWIGINTERN std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){ return **self; }
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }

/*@SWIG:/home/olly/git/xapian-1.4/TMP.make_dist.s3p9tdl3vS/swig/Lib/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
{
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  double *res = (double *)(args[1]);
  *res = NUM2DBL(obj); (void)type;
  return obj;
}
/*@SWIG@*/

SWIGINTERN int
SWIG_AsVal_double (VALUE obj, double *val)
{
  VALUE type = TYPE(obj);
  if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
    double v;
    VALUE a[2];
    a[0] = obj;
    a[1] = (VALUE)(&v);
    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
      if (val) *val = v;
      return SWIG_OK;
    }
  }
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_int (VALUE obj, int *val)
{
  long v;
  int res = SWIG_AsVal_long (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v < INT_MIN || v > INT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = static_cast< int >(v);
    }
  }  
  return res;
}


#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE VALUE 
SWIG_From_unsigned_SS_long_SS_long  (unsigned long long value)
{
  return ULL2NUM(value);
}
#endif


SWIGINTERNINLINE VALUE
SWIG_From_size_t  (size_t value)
{    
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
    return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else {
    /* assume sizeof(size_t) <= sizeof(unsigned long long) */
    return SWIG_From_unsigned_SS_long_SS_long  (static_cast< unsigned long long >(value));
  }
#endif
}


SWIGINTERN int
SWIG_AsVal_bool (VALUE obj, bool *val)
{
  if (obj == Qtrue) {
    if (val) *val = true;
    return SWIG_OK;
  } else if (obj == Qfalse) {
    if (val) *val = false;
    return SWIG_OK;
  } else {
    int res = 0;
    if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {    
      if (val) *val = res ? true : false;
      return SWIG_OK;
    }
  }  
  return SWIG_TypeError;
}


  #define SWIG_From_double   rb_float_new 

SWIGINTERN Xapian::docid Xapian_MSet_get_docid(Xapian::MSet const *self,Xapian::doccount i){
	return *(*self)[i];
    }
SWIGINTERN Xapian::Document Xapian_MSet_get_document(Xapian::MSet const *self,Xapian::doccount i){
	return (*self)[i].get_document();
    }
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 bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &o){ return *self == o; }
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_ESetIterator_equals(Xapian::ESetIterator const *self,Xapian::ESetIterator const &o){ return *self == o; }
SWIGINTERN std::string Xapian_ESetIterator_get_term(Xapian::ESetIterator const *self){ return **self; }
SWIGINTERN void Xapian_ESetIterator_next(Xapian::ESetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_ESetIterator_prev(Xapian::ESetIterator *self){ --(*self); }
SWIGINTERN Xapian::SimpleStopper *new_Xapian_SimpleStopper__SWIG_2(std::string const &file){
	ifstream in_file(file.c_str());
	if (!in_file.is_open())
	    throw Xapian::InvalidArgumentError("Stopword file not found: " + file);
	istream_iterator<std::string> in_iter(in_file);
	istream_iterator<std::string> eof;
	return new Xapian::SimpleStopper(in_iter, eof);
    }
SWIGINTERN bool Xapian_LatLongCoordsIterator_equals(Xapian::LatLongCoordsIterator const *self,Xapian::LatLongCoordsIterator const &o){ return *self == o; }
SWIGINTERN Xapian::LatLongCoord Xapian_LatLongCoordsIterator_get_coord(Xapian::LatLongCoordsIterator const *self){ return **self; }
SWIGINTERN void Xapian_LatLongCoordsIterator_next(Xapian::LatLongCoordsIterator *self){ ++(*self); }




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

/* ---------------------------------------------------
 * C++ director class helpers
 * --------------------------------------------------- */



/* ---------------------------------------------------
 * C++ director class methods
 * --------------------------------------------------- */

#include "xapian_wrap.h"

SwigDirector_StemImplementation::SwigDirector_StemImplementation(VALUE self): Xapian::StemImplementation(), Swig::Director(self) {
  
}



SwigDirector_StemImplementation::~SwigDirector_StemImplementation() {
}

std::string SwigDirector_StemImplementation::operator ()(std::string const &word) {
  std::string c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(word));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_StemImplementation::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_MatchDecider::SwigDirector_MatchDecider(VALUE self): Xapian::MatchDecider(), Swig::Director(self) {
  
}



bool SwigDirector_MatchDecider::operator ()(Xapian::Document const &doc) const {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&doc), SWIGTYPE_p_Xapian__Document,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


SwigDirector_MatchDecider::~SwigDirector_MatchDecider() {
}

SwigDirector_ExpandDecider::SwigDirector_ExpandDecider(VALUE self): Xapian::ExpandDecider(), Swig::Director(self) {
  
}



bool SwigDirector_ExpandDecider::operator ()(std::string const &term) const {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(term));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


SwigDirector_ExpandDecider::~SwigDirector_ExpandDecider() {
}

SwigDirector_KeyMaker::SwigDirector_KeyMaker(VALUE self): Xapian::KeyMaker(), Swig::Director(self) {
  
}



std::string SwigDirector_KeyMaker::operator ()(Xapian::Document const &doc) const {
  std::string c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&doc), SWIGTYPE_p_Xapian__Document,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_KeyMaker::~SwigDirector_KeyMaker() {
}

SwigDirector_Stopper::SwigDirector_Stopper(VALUE self): Xapian::Stopper(), Swig::Director(self) {
  
}



bool SwigDirector_Stopper::operator ()(std::string const &term) const {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(term));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


SwigDirector_Stopper::~SwigDirector_Stopper() {
}

std::string SwigDirector_Stopper::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_RangeProcessor::SwigDirector_RangeProcessor(VALUE self): Xapian::RangeProcessor(), Swig::Director(self) {
  
}



SwigDirector_RangeProcessor::SwigDirector_RangeProcessor(VALUE self, Xapian::valueno slot_, std::string const &str_, unsigned int flags_): Xapian::RangeProcessor(slot_, str_, flags_), Swig::Director(self) {
  
}



SwigDirector_RangeProcessor::~SwigDirector_RangeProcessor() {
}

Xapian::Query SwigDirector_RangeProcessor::operator ()(std::string const &begin, std::string const &end) {
  Xapian::Query c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  void *swig_argp ;
  int swig_res = 0 ;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(begin));
  obj1 = SWIG_From_std_string(static_cast< std::string >(end));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 2,obj0,obj1);
  swig_res = SWIG_ConvertPtr(result,&swig_argp,SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::Query""'");
  }
  c_result = *(reinterpret_cast< Xapian::Query * >(swig_argp));
  return (Xapian::Query) c_result;
}


SwigDirector_ValueRangeProcessor::SwigDirector_ValueRangeProcessor(VALUE self): Xapian::ValueRangeProcessor(), Swig::Director(self) {
  
}



SwigDirector_ValueRangeProcessor::~SwigDirector_ValueRangeProcessor() {
}

Xapian::valueno SwigDirector_ValueRangeProcessor::operator ()(std::string &begin, std::string &end) {
  Xapian::valueno c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&begin), SWIGTYPE_p_std__string,  0 );
  obj1 = SWIG_NewPointerObj(SWIG_as_voidptr(&end), SWIGTYPE_p_std__string,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 2,obj0,obj1);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::valueno""'");
  }
  c_result = static_cast< Xapian::valueno >(swig_val);
  return (Xapian::valueno) c_result;
}


SwigDirector_FieldProcessor::SwigDirector_FieldProcessor(VALUE self): Xapian::FieldProcessor(), Swig::Director(self) {
  
}



SwigDirector_FieldProcessor::~SwigDirector_FieldProcessor() {
}

Xapian::Query SwigDirector_FieldProcessor::operator ()(std::string const &str) {
  Xapian::Query c_result ;
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  void *swig_argp ;
  int swig_res = 0 ;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(str));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 1,obj0);
  swig_res = SWIG_ConvertPtr(result,&swig_argp,SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::Query""'");
  }
  c_result = *(reinterpret_cast< Xapian::Query * >(swig_argp));
  return (Xapian::Query) c_result;
}


SwigDirector_Compactor::SwigDirector_Compactor(VALUE self): Xapian::Compactor(), Swig::Director(self) {
  
}



SwigDirector_Compactor::~SwigDirector_Compactor() {
}

void SwigDirector_Compactor::set_status(std::string const &table, std::string const &status) {
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(table));
  obj1 = SWIG_From_std_string(static_cast< std::string >(status));
  result = rb_funcall(swig_get_self(), rb_intern("set_status"), 2,obj0,obj1);
}


std::string SwigDirector_Compactor::resolve_duplicate_metadata(std::string const &key, size_t num_tags, std::string const tags[]) {
  std::string c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(key));
  {
    obj1 = rb_ary_new();
    for (size_t i = 0; i != num_tags; ++i) {
      VALUE str = rb_str_new(tags[i].data(), tags[i].size());
      rb_ary_push(obj1, str);
    }
  }
  result = rb_funcall(swig_get_self(), rb_intern("resolve_duplicate_metadata"), 2,obj0,obj1);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_PostingSource::SwigDirector_PostingSource(VALUE self): Xapian::PostingSource(), Swig::Director(self) {
  
}



SwigDirector_PostingSource::~SwigDirector_PostingSource() {
}

Xapian::doccount SwigDirector_PostingSource::get_termfreq_min() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_min"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_PostingSource::get_termfreq_est() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_est"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_PostingSource::get_termfreq_max() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_max"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


double SwigDirector_PostingSource::get_weight() const {
  double c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("weight"), 0, Qnil);
  double swig_val;
  int swig_res = SWIG_AsVal_double(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""double""'");
  }
  c_result = static_cast< double >(swig_val);
  return (double) c_result;
}


Xapian::docid SwigDirector_PostingSource::get_docid() const {
  Xapian::docid c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("docid"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::docid""'");
  }
  c_result = static_cast< Xapian::docid >(swig_val);
  return (Xapian::docid) c_result;
}


void SwigDirector_PostingSource::next(double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("next"), 1,obj0);
}


void SwigDirector_PostingSource::skip_to(Xapian::docid did, double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(did));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("skip_to"), 2,obj0,obj1);
}


bool SwigDirector_PostingSource::check(Xapian::docid did, double min_wt) {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(did));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("check"), 2,obj0,obj1);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


bool SwigDirector_PostingSource::at_end() const {
  bool c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("at_end"), 0, Qnil);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


Xapian::PostingSource *SwigDirector_PostingSource::clone() const {
  return Xapian::PostingSource::clone();
}


std::string SwigDirector_PostingSource::name() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("name"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_PostingSource::serialise() const {
  return Xapian::PostingSource::serialise();
}


Xapian::PostingSource *SwigDirector_PostingSource::unserialise(std::string const &serialised) const {
  return Xapian::PostingSource::unserialise(serialised);
}


Xapian::PostingSource *SwigDirector_PostingSource::unserialise_with_registry(std::string const &serialised, Xapian::Registry const &registry) const {
  return Xapian::PostingSource::unserialise_with_registry(serialised,registry);
}


void SwigDirector_PostingSource::init(Xapian::Database const &db) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&db), SWIGTYPE_p_Xapian__Database,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("init"), 1,obj0);
}


std::string SwigDirector_PostingSource::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_ValuePostingSource::SwigDirector_ValuePostingSource(VALUE self, Xapian::valueno slot_): Xapian::ValuePostingSource(slot_), Swig::Director(self) {
  
}



SwigDirector_ValuePostingSource::~SwigDirector_ValuePostingSource() {
}

Xapian::doccount SwigDirector_ValuePostingSource::get_termfreq_min() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_min"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_ValuePostingSource::get_termfreq_est() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_est"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_ValuePostingSource::get_termfreq_max() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_max"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


double SwigDirector_ValuePostingSource::get_weight() const {
  double c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("weight"), 0, Qnil);
  double swig_val;
  int swig_res = SWIG_AsVal_double(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""double""'");
  }
  c_result = static_cast< double >(swig_val);
  return (double) c_result;
}


Xapian::docid SwigDirector_ValuePostingSource::get_docid() const {
  Xapian::docid c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("docid"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::docid""'");
  }
  c_result = static_cast< Xapian::docid >(swig_val);
  return (Xapian::docid) c_result;
}


void SwigDirector_ValuePostingSource::next(double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("next"), 1,obj0);
}


void SwigDirector_ValuePostingSource::skip_to(Xapian::docid min_docid, double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(min_docid));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("skip_to"), 2,obj0,obj1);
}


bool SwigDirector_ValuePostingSource::check(Xapian::docid min_docid, double min_wt) {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(min_docid));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("check"), 2,obj0,obj1);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


bool SwigDirector_ValuePostingSource::at_end() const {
  bool c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("at_end"), 0, Qnil);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


Xapian::PostingSource *SwigDirector_ValuePostingSource::clone() const {
  return Xapian::PostingSource::clone();
}


std::string SwigDirector_ValuePostingSource::name() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("name"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_ValuePostingSource::serialise() const {
  return Xapian::PostingSource::serialise();
}


Xapian::PostingSource *SwigDirector_ValuePostingSource::unserialise(std::string const &serialised) const {
  return Xapian::PostingSource::unserialise(serialised);
}


Xapian::PostingSource *SwigDirector_ValuePostingSource::unserialise_with_registry(std::string const &serialised, Xapian::Registry const &registry) const {
  return Xapian::PostingSource::unserialise_with_registry(serialised,registry);
}


void SwigDirector_ValuePostingSource::init(Xapian::Database const &db_) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&db_), SWIGTYPE_p_Xapian__Database,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("init"), 1,obj0);
}


std::string SwigDirector_ValuePostingSource::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_ValueWeightPostingSource::SwigDirector_ValueWeightPostingSource(VALUE self, Xapian::valueno slot_): Xapian::ValueWeightPostingSource(slot_), Swig::Director(self) {
  
}



SwigDirector_ValueWeightPostingSource::~SwigDirector_ValueWeightPostingSource() {
}

Xapian::doccount SwigDirector_ValueWeightPostingSource::get_termfreq_min() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_min"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_ValueWeightPostingSource::get_termfreq_est() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_est"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


Xapian::doccount SwigDirector_ValueWeightPostingSource::get_termfreq_max() const {
  Xapian::doccount c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("get_termfreq_max"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::doccount""'");
  }
  c_result = static_cast< Xapian::doccount >(swig_val);
  return (Xapian::doccount) c_result;
}


double SwigDirector_ValueWeightPostingSource::get_weight() const {
  double c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("weight"), 0, Qnil);
  double swig_val;
  int swig_res = SWIG_AsVal_double(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""double""'");
  }
  c_result = static_cast< double >(swig_val);
  return (double) c_result;
}


Xapian::docid SwigDirector_ValueWeightPostingSource::get_docid() const {
  Xapian::docid c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("docid"), 0, Qnil);
  unsigned int swig_val;
  int swig_res = SWIG_AsVal_unsigned_SS_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""Xapian::docid""'");
  }
  c_result = static_cast< Xapian::docid >(swig_val);
  return (Xapian::docid) c_result;
}


void SwigDirector_ValueWeightPostingSource::next(double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("next"), 1,obj0);
}


void SwigDirector_ValueWeightPostingSource::skip_to(Xapian::docid min_docid, double min_wt) {
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(min_docid));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("skip_to"), 2,obj0,obj1);
}


bool SwigDirector_ValueWeightPostingSource::check(Xapian::docid min_docid, double min_wt) {
  bool c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(min_docid));
  obj1 = SWIG_From_double(static_cast< double >(min_wt));
  result = rb_funcall(swig_get_self(), rb_intern("check"), 2,obj0,obj1);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


bool SwigDirector_ValueWeightPostingSource::at_end() const {
  bool c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("at_end"), 0, Qnil);
  bool swig_val;
  int swig_res = SWIG_AsVal_bool(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""bool""'");
  }
  c_result = static_cast< bool >(swig_val);
  return (bool) c_result;
}


Xapian::ValueWeightPostingSource *SwigDirector_ValueWeightPostingSource::clone() const {
  return Xapian::ValueWeightPostingSource::clone();
}


std::string SwigDirector_ValueWeightPostingSource::name() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("name"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_ValueWeightPostingSource::serialise() const {
  return Xapian::ValueWeightPostingSource::serialise();
}


Xapian::ValueWeightPostingSource *SwigDirector_ValueWeightPostingSource::unserialise(std::string const &serialised) const {
  return Xapian::ValueWeightPostingSource::unserialise(serialised);
}


Xapian::PostingSource *SwigDirector_ValueWeightPostingSource::unserialise_with_registry(std::string const &serialised, Xapian::Registry const &registry) const {
  return Xapian::PostingSource::unserialise_with_registry(serialised,registry);
}


void SwigDirector_ValueWeightPostingSource::init(Xapian::Database const &db_) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&db_), SWIGTYPE_p_Xapian__Database,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("init"), 1,obj0);
}


std::string SwigDirector_ValueWeightPostingSource::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_MatchSpy::SwigDirector_MatchSpy(VALUE self): Xapian::MatchSpy(), Swig::Director(self) {
  
}



SwigDirector_MatchSpy::~SwigDirector_MatchSpy() {
}

void SwigDirector_MatchSpy::operator ()(Xapian::Document const &doc, double wt) {
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&doc), SWIGTYPE_p_Xapian__Document,  0 );
  obj1 = SWIG_From_double(static_cast< double >(wt));
  result = rb_funcall(swig_get_self(), rb_intern("__call__"), 2,obj0,obj1);
}


Xapian::MatchSpy *SwigDirector_MatchSpy::clone() const {
  return Xapian::MatchSpy::clone();
}


std::string SwigDirector_MatchSpy::name() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("name"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_MatchSpy::serialise() const {
  return Xapian::MatchSpy::serialise();
}


Xapian::MatchSpy *SwigDirector_MatchSpy::unserialise(std::string const &serialised, Xapian::Registry const &context) const {
  return Xapian::MatchSpy::unserialise(serialised,context);
}


std::string SwigDirector_MatchSpy::serialise_results() const {
  return Xapian::MatchSpy::serialise_results();
}


void SwigDirector_MatchSpy::merge_results(std::string const &serialised) {
  VALUE obj0 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_From_std_string(static_cast< std::string >(serialised));
  result = rb_funcall(swig_get_self(), rb_intern("merge_results"), 1,obj0);
}


std::string SwigDirector_MatchSpy::get_description() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("description"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


SwigDirector_LatLongMetric::SwigDirector_LatLongMetric(VALUE self): Xapian::LatLongMetric(), Swig::Director(self) {
  
}



SwigDirector_LatLongMetric::~SwigDirector_LatLongMetric() {
}

double SwigDirector_LatLongMetric::pointwise_distance(Xapian::LatLongCoord const &a, Xapian::LatLongCoord const &b) const {
  double c_result ;
  VALUE obj0 = Qnil ;
  VALUE obj1 = Qnil ;
  VALUE SWIGUNUSED result;
  
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(&a), SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  obj1 = SWIG_NewPointerObj(SWIG_as_voidptr(&b), SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  result = rb_funcall(swig_get_self(), rb_intern("pointwise_distance"), 2,obj0,obj1);
  double swig_val;
  int swig_res = SWIG_AsVal_double(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""double""'");
  }
  c_result = static_cast< double >(swig_val);
  return (double) c_result;
}


Xapian::LatLongMetric *SwigDirector_LatLongMetric::clone() const {
  Xapian::LatLongMetric *c_result ;
  
  Swig::DirectorPureVirtualException::raise("Attempted to invoke pure virtual method Xapian::LatLongMetric::clone");
  return (Xapian::LatLongMetric *) c_result;
}


std::string SwigDirector_LatLongMetric::name() const {
  std::string c_result ;
  VALUE SWIGUNUSED result;
  
  result = rb_funcall(swig_get_self(), rb_intern("name"), 0, Qnil);
  std::string *swig_optr = 0;
  int swig_ores = SWIG_AsPtr_std_string(result, &swig_optr);
  if (!SWIG_IsOK(swig_ores) || !swig_optr) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError((swig_optr ? swig_ores : SWIG_TypeError))), "in output value of type '""std::string""'");
  }
  c_result = *swig_optr;
  if (SWIG_IsNewObj(swig_ores)) delete swig_optr;
  return (std::string) c_result;
}


std::string SwigDirector_LatLongMetric::serialise() const {
  std::string c_result ;
  
  Swig::DirectorPureVirtualException::raise("Attempted to invoke pure virtual method Xapian::LatLongMetric::serialise");
  return (std::string) c_result;
}


Xapian::LatLongMetric *SwigDirector_LatLongMetric::unserialise(std::string const &serialised) const {
  Xapian::LatLongMetric *c_result ;
  
  Swig::DirectorPureVirtualException::raise("Attempted to invoke pure virtual method Xapian::LatLongMetric::unserialise");
  return (Xapian::LatLongMetric *) c_result;
}


static swig_class SwigClassGC_VALUE;


/*
  Document-method: Xapian::GC_VALUE.inspect

  call-seq:
    inspect -> VALUE

Inspect class and its contents.
*/
SWIGINTERN VALUE
_wrap_GC_VALUE_inspect(int argc, VALUE *argv, VALUE self) {
  swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
  swig::GC_VALUE r1 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  r1 = self; arg1 = &r1;
  result = (VALUE)((swig::GC_VALUE const *)arg1)->inspect();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::GC_VALUE.to_s

  call-seq:
    to_s -> VALUE

Convert class to a String representation.
*/
SWIGINTERN VALUE
_wrap_GC_VALUE_to_s(int argc, VALUE *argv, VALUE self) {
  swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
  swig::GC_VALUE r1 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  r1 = self; arg1 = &r1;
  result = (VALUE)((swig::GC_VALUE const *)arg1)->to_s();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassConstIterator;

SWIGINTERN void
free_swig_ConstIterator(void *self) {
    swig::ConstIterator *arg1 = (swig::ConstIterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_ConstIterator_value(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","value", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  try {
    result = (VALUE)((swig::ConstIterator const *)arg1)->value();
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.dup

  call-seq:
    dup -> ConstIterator

Create a duplicate of the class and unfreeze it if needed.
*/
SWIGINTERN VALUE
_wrap_ConstIterator_dup(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","dup", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->dup();
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.inspect

  call-seq:
    inspect -> VALUE

Inspect class and its contents.
*/
SWIGINTERN VALUE
_wrap_ConstIterator_inspect(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","inspect", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  result = (VALUE)((swig::ConstIterator const *)arg1)->inspect();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.to_s

  call-seq:
    to_s -> VALUE

Convert class to a String representation.
*/
SWIGINTERN VALUE
_wrap_ConstIterator_to_s(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","to_s", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  result = (VALUE)((swig::ConstIterator const *)arg1)->to_s();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ConstIterator_next__SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","next", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (swig::ConstIterator *)(arg1)->next(arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ConstIterator_next__SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  try {
    result = (swig::ConstIterator *)(arg1)->next();
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_ConstIterator_next(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_ConstIterator_next__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_size_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_ConstIterator_next__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "ConstIterator.next", 
    "    swig::ConstIterator ConstIterator.next(size_t n)\n"
    "    swig::ConstIterator * ConstIterator.next()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ConstIterator_previous__SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","previous", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","previous", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (swig::ConstIterator *)(arg1)->previous(arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ConstIterator_previous__SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","previous", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  try {
    result = (swig::ConstIterator *)(arg1)->previous();
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_ConstIterator_previous(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_ConstIterator_previous__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_size_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_ConstIterator_previous__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "ConstIterator.previous", 
    "    swig::ConstIterator ConstIterator.previous(size_t n)\n"
    "    swig::ConstIterator * ConstIterator.previous()\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.==

  call-seq:
    ==(x) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_ConstIterator___eq__(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  swig::ConstIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator ==", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__ConstIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::ConstIterator const &","operator ==", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::ConstIterator const &","operator ==", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< swig::ConstIterator * >(argp2);
  result = (bool)((swig::ConstIterator const *)arg1)->operator ==((swig::ConstIterator const &)*arg2);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.+

  call-seq:
    +(n) -> ConstIterator

Add operator.
*/
SWIGINTERN VALUE
_wrap_ConstIterator___add__(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator +", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator +", 2, argv[0] ));
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->operator +(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ConstIterator.-

  call-seq:
    -(n) -> ConstIterator
    -(x) -> ptrdiff_t

Substraction operator.
*/
SWIGINTERN VALUE
_wrap_ConstIterator___sub____SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  swig::ConstIterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator -", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator -", 2, argv[0] ));
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->operator -(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ConstIterator___sub____SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
  swig::ConstIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  ptrdiff_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator -", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__ConstIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::ConstIterator const &","operator -", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::ConstIterator const &","operator -", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< swig::ConstIterator * >(argp2);
  result = ((swig::ConstIterator const *)arg1)->operator -((swig::ConstIterator const &)*arg2);
  vresult = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_ConstIterator___sub__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_ConstIterator___sub____SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_ConstIterator___sub____SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "ConstIterator.__sub__", 
    "    swig::ConstIterator ConstIterator.__sub__(ptrdiff_t n)\n"
    "    ptrdiff_t ConstIterator.__sub__(swig::ConstIterator const &x)\n");
  
  return Qnil;
}


static swig_class SwigClassIterator;

SWIGINTERN VALUE
_wrap_Iterator_valuee___(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  VALUE *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE temp2 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","setValue", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  temp2 = static_cast< VALUE >(argv[0]);
  arg2 = &temp2;
  result = (VALUE)(arg1)->setValue((VALUE const &)*arg2);
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.dup

  call-seq:
    dup -> Iterator

Create a duplicate of the class and unfreeze it if needed.
*/
SWIGINTERN VALUE
_wrap_Iterator_dup(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","dup", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  result = (swig::Iterator *)((swig::Iterator const *)arg1)->dup();
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Iterator_next__SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","next", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (swig::Iterator *)(arg1)->next(arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Iterator_next__SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  try {
    result = (swig::Iterator *)(arg1)->next();
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Iterator_next(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Iterator_next__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_size_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Iterator_next__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Iterator.next", 
    "    swig::Iterator Iterator.next(size_t n)\n"
    "    swig::Iterator * Iterator.next()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Iterator_previous__SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","previous", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","previous", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (swig::Iterator *)(arg1)->previous(arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Iterator_previous__SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","previous", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  try {
    result = (swig::Iterator *)(arg1)->previous();
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Iterator_previous(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Iterator_previous__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_size_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Iterator_previous__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Iterator.previous", 
    "    swig::Iterator Iterator.previous(size_t n)\n"
    "    swig::Iterator * Iterator.previous()\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.inspect

  call-seq:
    inspect -> VALUE

Inspect class and its contents.
*/
SWIGINTERN VALUE
_wrap_Iterator_inspect(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","inspect", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  result = (VALUE)((swig::Iterator const *)arg1)->inspect();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.to_s

  call-seq:
    to_s -> VALUE

Convert class to a String representation.
*/
SWIGINTERN VALUE
_wrap_Iterator_to_s(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  VALUE result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","to_s", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  result = (VALUE)((swig::Iterator const *)arg1)->to_s();
  vresult = result;
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.==

  call-seq:
    ==(x) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_Iterator___eq__(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  swig::Iterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator ==", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__Iterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::Iterator const &","operator ==", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::Iterator const &","operator ==", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< swig::Iterator * >(argp2);
  result = (bool)((swig::Iterator const *)arg1)->operator ==((swig::Iterator const &)*arg2);
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.+

  call-seq:
    +(n) -> Iterator

Add operator.
*/
SWIGINTERN VALUE
_wrap_Iterator___add__(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator +", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator +", 2, argv[0] ));
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::Iterator *)((swig::Iterator const *)arg1)->operator +(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Iterator.-

  call-seq:
    -(n) -> Iterator
    -(x) -> ptrdiff_t

Substraction operator.
*/
SWIGINTERN VALUE
_wrap_Iterator___sub____SWIG_0(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  swig::Iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator -", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator -", 2, argv[0] ));
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::Iterator *)((swig::Iterator const *)arg1)->operator -(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      (void)_e;
      SWIG_Ruby_ExceptionType(NULL, Qnil);
      SWIG_fail;
    }
  }
  
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Iterator___sub____SWIG_1(int argc, VALUE *argv, VALUE self) {
  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
  swig::Iterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  ptrdiff_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator -", 1, self )); 
  }
  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__Iterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::Iterator const &","operator -", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::Iterator const &","operator -", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< swig::Iterator * >(argp2);
  result = ((swig::Iterator const *)arg1)->operator -((swig::Iterator const &)*arg2);
  vresult = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Iterator___sub__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_swig__Iterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Iterator___sub____SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Iterator___sub____SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Iterator.__sub__", 
    "    swig::Iterator Iterator.__sub__(ptrdiff_t n)\n"
    "    ptrdiff_t Iterator.__sub__(swig::Iterator const &x)\n");
  
  return Qnil;
}


SWIGINTERN void
free_swig_Iterator(void *self) {
    swig::Iterator *arg1 = (swig::Iterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_version_string(int argc, VALUE *argv, VALUE self) {
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (char *)Xapian::version_string();
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_major_version(int argc, VALUE *argv, VALUE self) {
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (int)Xapian::major_version();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_minor_version(int argc, VALUE *argv, VALUE self) {
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (int)Xapian::minor_version();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_revision(int argc, VALUE *argv, VALUE self) {
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (int)Xapian::revision();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassPositionIterator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_PositionIterator_allocate(VALUE self)
#else
_wrap_PositionIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__PositionIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_PositionIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::PositionIterator";
  Xapian::PositionIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_PositionIterator(void *self) {
    Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_PositionIterator_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termpos","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termpos >(val2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PositionIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      result = ((Xapian::PositionIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PositionIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__PositionIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::PositionIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PositionIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::PositionIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PositionIterator_termpos(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termpos result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator const *","get_termpos", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      result = (Xapian::termpos)Xapian_PositionIterator_get_termpos((Xapian::PositionIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PositionIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.==

  call-seq:
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap___eq____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__PositionIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PositionIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PositionIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__PositionIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::PositionIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PositionIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::PositionIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::PositionIterator const &)*arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassPostingIterator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_PostingIterator_allocate(VALUE self)
#else
_wrap_PostingIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__PostingIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_PostingIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::PostingIterator";
  Xapian::PostingIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_PostingIterator(void *self) {
    Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_PostingIterator_wdf(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","get_wdf", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_wdf();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_doclength(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","get_doclength", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_get_unique_terms(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","get_unique_terms", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_unique_terms();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator__dangerous_positionlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","positionlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->positionlist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator__dangerous_positionlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","positionlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  result = ((Xapian::PostingIterator const *)arg1)->positionlist_end();
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__PostingIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::PostingIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PostingIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::PostingIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::docid)Xapian_PostingIterator_get_docid((Xapian::PostingIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap___eq____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__PostingIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PostingIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__PostingIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::PostingIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PostingIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::PostingIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::PostingIterator const &)*arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassTermIterator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_TermIterator_allocate(VALUE self)
#else
_wrap_TermIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__TermIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_TermIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::TermIterator";
  Xapian::TermIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Xapian::TermIterator *)new Xapian::TermIterator();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_TermIterator(void *self) {
    Xapian::TermIterator *arg1 = (Xapian::TermIterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_TermIterator_wdf(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","get_wdf", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->get_wdf();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_termfreq(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","get_termfreq", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::TermIterator const *)arg1)->get_termfreq();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_positionlist_count(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","positionlist_count", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->positionlist_count();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator__dangerous_positionlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","positionlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = ((Xapian::TermIterator const *)arg1)->positionlist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator__dangerous_positionlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","positionlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  result = ((Xapian::TermIterator const *)arg1)->positionlist_end();
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","skip_to", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","skip_to", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = ((Xapian::TermIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__TermIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::TermIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::TermIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::TermIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_term(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const *","get_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = Xapian_TermIterator_get_term((Xapian::TermIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap___eq____SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__TermIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::TermIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__TermIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::TermIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::TermIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::TermIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::TermIterator const &)*arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassValueIterator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueIterator_allocate(VALUE self)
#else
_wrap_ValueIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::ValueIterator";
  Xapian::ValueIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueIterator(void *self) {
    Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_ValueIterator_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = (Xapian::docid)((Xapian::ValueIterator const *)arg1)->get_docid();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_valueno(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const *","get_valueno", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = (Xapian::valueno)((Xapian::ValueIterator const *)arg1)->get_valueno();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_check(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (bool)(arg1)->check(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = ((Xapian::ValueIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__ValueIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ValueIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ValueIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::ValueIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_value(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const *","get_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = Xapian_ValueIterator_get_value((Xapian::ValueIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap___eq____SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ValueIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ValueIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ValueIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ValueIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ValueIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ValueIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::ValueIterator const &)*arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassDocument;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Document_allocate(VALUE self)
#else
_wrap_Document_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Document);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Document(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::Document";
  Xapian::Document *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::Document *)new Xapian::Document();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_Document(void *self) {
    Xapian::Document *arg1 = (Xapian::Document *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Document_value(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","get_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","get_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_value(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","add_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_value", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_value", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_value(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","remove_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->remove_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_clear_values(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","clear_values", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      (arg1)->clear_values();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_data(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","get_data", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_data();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_datae___(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","set_data", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_data", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_data", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_posting__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_posting", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_posting", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_posting", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","add_posting", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","add_posting", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_posting__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_posting", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_posting", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_posting", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","add_posting", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Document_add_posting(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_add_posting__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Document_add_posting__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "Document.add_posting", 
    "    void Document.add_posting(std::string const &tname, Xapian::termpos tpos, Xapian::termcount wdfinc)\n"
    "    void Document.add_posting(std::string const &tname, Xapian::termpos tpos)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_term__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_term", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_term", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","add_term", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_term__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_term", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_term", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Document_add_term(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Document_add_term__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_add_term__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Document.add_term", 
    "    void Document.add_term(std::string const &tname, Xapian::termcount wdfinc)\n"
    "    void Document.add_term(std::string const &tname)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_add_boolean_term(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","add_boolean_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_term", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_term", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_boolean_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_posting__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_posting", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_posting", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_posting", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","remove_posting", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","remove_posting", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_posting__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_posting", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_posting", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_posting", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","remove_posting", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Document_remove_posting(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_remove_posting__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Document_remove_posting__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "Document.remove_posting", 
    "    void Document.remove_posting(std::string const &tname, Xapian::termpos tpos, Xapian::termcount wdfdec)\n"
    "    void Document.remove_posting(std::string const &tname, Xapian::termpos tpos)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_postings__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termpos arg4 ;
  Xapian::termcount arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  Xapian::termpos result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_postings", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_postings", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_postings", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","remove_postings", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termpos","remove_postings", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termpos >(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Xapian::termcount","remove_postings", 5, argv[3] ));
  } 
  arg5 = static_cast< Xapian::termcount >(val5);
  {
    try {
      result = (Xapian::termpos)(arg1)->remove_postings((std::string const &)*arg2,arg3,arg4,arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_postings__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termpos arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  Xapian::termpos result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_postings", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_postings", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_postings", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","remove_postings", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termpos","remove_postings", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termpos >(val4);
  {
    try {
      result = (Xapian::termpos)(arg1)->remove_postings((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Document_remove_postings(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[6];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 6) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Document_remove_postings__SWIG_1(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_Document_remove_postings__SWIG_0(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 6, "Document.remove_postings", 
    "    Xapian::termpos Document.remove_postings(std::string const &term, Xapian::termpos term_pos_first, Xapian::termpos term_pos_last, Xapian::termcount wdf_dec)\n"
    "    Xapian::termpos Document.remove_postings(std::string const &term, Xapian::termpos term_pos_first, Xapian::termpos term_pos_last)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_remove_term(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","remove_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_term", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_term", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_clear_terms(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document *","clear_terms", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      (arg1)->clear_terms();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_termlist_count(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","termlist_count", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->termlist_count();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document__dangerous_termlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","termlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document__dangerous_termlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","termlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  result = ((Xapian::Document const *)arg1)->termlist_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_values_count(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","values_count", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->values_count();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document__dangerous_values_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ValueIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","values_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document__dangerous_values_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ValueIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","values_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  result = ((Xapian::Document const *)arg1)->values_end();
  vresult = SWIG_NewPointerObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::docid)((Xapian::Document const *)arg1)->get_docid();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_serialise(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","serialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_unserialise(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  Xapian::Document result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Document::unserialise", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Document::unserialise", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Document::unserialise((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Document_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Document const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassRegistry;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Registry_allocate(VALUE self)
#else
_wrap_Registry_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Registry);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Registry(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::Registry";
  Xapian::Registry *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::Registry *)new Xapian::Registry();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_Registry(void *self) {
    Xapian::Registry *arg1 = (Xapian::Registry *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Registry_register_weighting_scheme(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry *","register_weighting_scheme", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Weight,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Weight const &","register_weighting_scheme", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Weight const &","register_weighting_scheme", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Weight * >(argp2);
  {
    try {
      (arg1)->register_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_get_weighting_scheme(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::Weight *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry const *","get_weighting_scheme", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_weighting_scheme", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_weighting_scheme", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::Weight *)((Xapian::Registry const *)arg1)->get_weighting_scheme((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_register_posting_source(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::PostingSource *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry *","register_posting_source", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__PostingSource,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::PostingSource const &","register_posting_source", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::PostingSource const &","register_posting_source", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::PostingSource * >(argp2);
  {
    try {
      (arg1)->register_posting_source((Xapian::PostingSource const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_get_posting_source(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::PostingSource *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry const *","get_posting_source", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_posting_source", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_posting_source", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::PostingSource *)((Xapian::Registry const *)arg1)->get_posting_source((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_register_match_spy(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::MatchSpy *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry *","register_match_spy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MatchSpy,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MatchSpy const &","register_match_spy", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MatchSpy const &","register_match_spy", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MatchSpy * >(argp2);
  {
    try {
      (arg1)->register_match_spy((Xapian::MatchSpy const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_get_match_spy(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::MatchSpy *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry const *","get_match_spy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_match_spy", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_match_spy", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::MatchSpy *)((Xapian::Registry const *)arg1)->get_match_spy((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_register_lat_long_metric(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::LatLongMetric *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry *","register_lat_long_metric", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","register_lat_long_metric", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","register_lat_long_metric", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongMetric * >(argp2);
  {
    try {
      (arg1)->register_lat_long_metric((Xapian::LatLongMetric const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Registry_get_lat_long_metric(int argc, VALUE *argv, VALUE self) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::LatLongMetric *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Registry, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Registry const *","get_lat_long_metric", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Registry * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_lat_long_metric", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_lat_long_metric", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::LatLongMetric *)((Xapian::Registry const *)arg1)->get_lat_long_metric((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


static swig_class SwigClassQuery;

SWIGINTERN VALUE
_wrap_new_Query__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Xapian::Query *)new Xapian::Query();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_Query(void *self) {
    Xapian::Query *arg1 = (Xapian::Query *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_new_Query__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::termpos arg3 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Query", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termpos","Query", 3, argv[2] ));
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Query", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_3(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Query", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","Query", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_5(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  Xapian::Query *arg2 = 0 ;
  double val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Query const &","Query", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","Query", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  double arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Query const &","Query", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","Query", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","Query", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_7(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::Query *arg3 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Query const &","Query", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","Query", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::Query const &","Query", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","Query", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::Query * >(argp3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,(Xapian::Query const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_8(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Query", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","Query", 3, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 3, argv[2])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,(std::string const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_9(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","Query", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","Query", 3, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 3, argv[2])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res3)) delete arg3;
  return self;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_10(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string *arg4 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  int res4 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","Query", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","Query", 3, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 3, argv[2])); 
    }
    arg3 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res4 = SWIG_AsPtr_std_string(argv[3], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const &","Query", 4, argv[3] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 4, argv[3])); 
    }
    arg4 = ptr;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3,(std::string const &)*arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res3)) delete arg3;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return self;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_11(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  int arg4 ;
  Xapian::Query::op arg5 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Query", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 3, argv[2] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Query", 4, argv[3] ));
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 5, argv[4] ));
  } 
  arg5 = static_cast< Xapian::Query::op >(val5);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,arg3,arg4,arg5);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_12(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  int arg4 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Query", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 3, argv[2] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Query", 4, argv[3] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_13(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Query", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 3, argv[2] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_14(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Query", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Query", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_17(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  XapianSWIGQueryItor arg2 ;
  XapianSWIGQueryItor arg3 ;
  Xapian::termcount arg4 ;
  int val1 ;
  int ecode1 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    if (TYPE(argv[1]) == T_ARRAY) {
      // The typecheck typemap should have ensured this is an array.
      (&arg2)->begin(argv[1]);
      (&arg3)->end(RARRAY_LEN(argv[1]));
    } else {
      (&arg2)->end(0);
      (&arg3)->end(0);
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","Query", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_18(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  XapianSWIGQueryItor arg2 ;
  XapianSWIGQueryItor arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    if (TYPE(argv[1]) == T_ARRAY) {
      // The typecheck typemap should have ensured this is an array.
      (&arg2)->begin(argv[1]);
      (&arg3)->end(RARRAY_LEN(argv[1]));
    } else {
      (&arg2)->end(0);
      (&arg3)->end(0);
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query__dangerous_terms_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_terms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query__dangerous_terms_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_terms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = ((Xapian::Query const *)arg1)->get_terms_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query__dangerous_unique_terms_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_unique_terms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_unique_terms_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query__dangerous_unique_terms_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_unique_terms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = ((Xapian::Query const *)arg1)->get_unique_terms_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_length(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_length", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = (Xapian::termcount)((Xapian::Query const *)arg1)->get_length();
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Query.empty

  call-seq:
    empty -> bool

Check if the Query is empty or not.
*/
SWIGINTERN VALUE
_wrap_Query_emptyq___(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","empty", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = (bool)((Xapian::Query const *)arg1)->empty();
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_serialise(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","serialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  {
    try {
      result = ((Xapian::Query const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_unserialise__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  Xapian::Registry *arg2 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Query::unserialise", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Query::unserialise", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__Registry,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Registry const &","Xapian::Query::unserialise", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Registry const &","Xapian::Query::unserialise", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::Registry * >(argp2);
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1,(Xapian::Registry const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_unserialise__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Query::unserialise", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Query::unserialise", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Query_unserialise(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Query_unserialise__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Registry, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Query_unserialise__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "Query.unserialise", 
    "    Xapian::Query const Query.unserialise(std::string const &serialised, Xapian::Registry const &reg)\n"
    "    Xapian::Query const Query.unserialise(std::string const &serialised)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_type(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Query::op result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_type", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = (Xapian::Query::op)((Xapian::Query const *)arg1)->get_type();
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_get_num_subqueries(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_num_subqueries", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  result = ((Xapian::Query const *)arg1)->get_num_subqueries();
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_get_subquery(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_subquery", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","get_subquery", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_subquery(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Query_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Query const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Query * >(argp1);
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Query_allocate(VALUE self)
#else
_wrap_Query_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Query);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Query__SWIG_19(int argc, VALUE *argv, VALUE self) {
  Xapian::Query::op arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Query";
  Xapian::Query *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::Query::op","Query", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::Query::op >(val1);
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_Query(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs;
  if (argc > 5) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_Query__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__PostingSource, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Query__SWIG_4(nargs, args, self);
    }
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_Query__SWIG_19(nargs, args, self);
    }
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Query__SWIG_3(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_Query__SWIG_14(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = (TYPE(argv[1]) == T_ARRAY);
        /* Currently, the only wrapped method which takes a Ruby array is the
             * "extra" constructor Query(OP, ARRAY), where ARRAY can contain any mix of
             * strings and Query objects.
             *
             * If we ever had a method (or function) which had two overloaded forms
             * only differentiated by what type of array can be passed we'd need to
             * look at the type of the array elements in the typecheck typemaps.
             */
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Query__SWIG_18(nargs, args, self);
        }
        return _wrap_new_Query__SWIG_18(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Query, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_Query__SWIG_5(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_Query__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Query, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__Query, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_Query__SWIG_7(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Query, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_6(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_Query__SWIG_9(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_13(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_Query__SWIG_8(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = (TYPE(argv[1]) == T_ARRAY);
        /* Currently, the only wrapped method which takes a Ruby array is the
             * "extra" constructor Query(OP, ARRAY), where ARRAY can contain any mix of
             * strings and Query objects.
             *
             * If we ever had a method (or function) which had two overloaded forms
             * only differentiated by what type of array can be passed we'd need to
             * look at the type of the array elements in the typecheck typemaps.
             */
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_17(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Query__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_new_Query__SWIG_10(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_Query__SWIG_12(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_Query__SWIG_11(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "Query.new", 
    "    Query.new()\n"
    "    Query.new(std::string const &term, Xapian::termcount wqf, Xapian::termpos pos)\n"
    "    Query.new(std::string const &term, Xapian::termcount wqf)\n"
    "    Query.new(std::string const &term)\n"
    "    Query.new(Xapian::PostingSource *source)\n"
    "    Query.new(double factor, Xapian::Query const &subquery)\n"
    "    Query.new(Xapian::Query::op op_, Xapian::Query const &subquery, double factor)\n"
    "    Query.new(Xapian::Query::op op_, Xapian::Query const &a, Xapian::Query const &b)\n"
    "    Query.new(Xapian::Query::op op_, std::string const &a, std::string const &b)\n"
    "    Query.new(Xapian::Query::op op_, Xapian::valueno slot, std::string const &range_limit)\n"
    "    Query.new(Xapian::Query::op op_, Xapian::valueno slot, std::string const &range_lower, std::string const &range_upper)\n"
    "    Query.new(Xapian::Query::op op_, std::string const &pattern, Xapian::termcount max_expansion, int max_type, Xapian::Query::op combiner)\n"
    "    Query.new(Xapian::Query::op op_, std::string const &pattern, Xapian::termcount max_expansion, int max_type)\n"
    "    Query.new(Xapian::Query::op op_, std::string const &pattern, Xapian::termcount max_expansion)\n"
    "    Query.new(Xapian::Query::op op_, std::string const &pattern)\n"
    "    Query.new(Xapian::Query::op op_, XapianSWIGQueryItor qbegin, XapianSWIGQueryItor qend, Xapian::termcount parameter)\n"
    "    Query.new(Xapian::Query::op op_, XapianSWIGQueryItor qbegin, XapianSWIGQueryItor qend)\n"
    "    Query.new(Xapian::Query::op op_)\n");
  
  return Qnil;
}


static swig_class SwigClassStemImplementation;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_StemImplementation_allocate(VALUE self)
#else
_wrap_StemImplementation_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__StemImplementation);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_StemImplementation(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::StemImplementation";
  Xapian::StemImplementation *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::StemImplementation *)new SwigDirector_StemImplementation(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_StemImplementation(void *self) {
    Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_StemImplementation___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__StemImplementation, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::StemImplementation *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::StemImplementation * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::StemImplementation::operator ()");
        } else {
          result = (arg1)->operator ()((std::string const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_StemImplementation_description(int argc, VALUE *argv, VALUE self) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__StemImplementation, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::StemImplementation const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::StemImplementation * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::StemImplementation::get_description");
        } else {
          result = ((Xapian::StemImplementation const *)arg1)->get_description();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_StemImplementation(int argc, VALUE *argv, VALUE self) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__StemImplementation, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::StemImplementation *","disown_StemImplementation", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::StemImplementation * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassStem;

SWIGINTERN VALUE
_wrap_new_Stem__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Stem";
  Xapian::Stem *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Stem", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Stem", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Stem__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  bool arg2 ;
  int res1 = SWIG_OLDOBJ ;
  bool val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Stem";
  Xapian::Stem *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Stem", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Stem", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_bool(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","Stem", 2, argv[1] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem((std::string const &)*arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Stem_allocate(VALUE self)
#else
_wrap_Stem_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Stem);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Stem__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Stem";
  Xapian::Stem *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__StemImplementation, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::StemImplementation *","Stem", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::StemImplementation * >(argp1);
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_Stem(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__StemImplementation, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Stem__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Stem__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_bool(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_Stem__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "Stem.new", 
    "    Stem.new(std::string const &language)\n"
    "    Stem.new(std::string const &language, bool fallback)\n"
    "    Stem.new(Xapian::StemImplementation *p)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_Stem(void *self) {
    Xapian::Stem *arg1 = (Xapian::Stem *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Stem___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stem const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stem * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Stem const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Stem_is_none(int argc, VALUE *argv, VALUE self) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stem const *","is_none", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stem * >(argp1);
  {
    try {
      result = (bool)((Xapian::Stem const *)arg1)->is_none();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Stem_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stem const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stem * >(argp1);
  {
    try {
      result = ((Xapian::Stem const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Stem_available_languages(int argc, VALUE *argv, VALUE self) {
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = Xapian::Stem::get_available_languages();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassTermGenerator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_TermGenerator_allocate(VALUE self)
#else
_wrap_TermGenerator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__TermGenerator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_TermGenerator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::TermGenerator";
  Xapian::TermGenerator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::TermGenerator *)new Xapian::TermGenerator();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_TermGenerator(void *self) {
    Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_TermGenerator_stemmere___(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_stemmer", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Stem const &","set_stemmer", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","set_stemmer", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Stem * >(argp2);
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_stoppere_____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_stopper", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Stopper const *","set_stopper", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::Stopper * >(argp2);
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_stoppere_____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_stopper", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_TermGenerator_stoppere___(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_TermGenerator_stoppere_____SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Stopper, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_TermGenerator_stoppere_____SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "TermGenerator.stopper=", 
    "    void TermGenerator.stopper=(Xapian::Stopper const *stop)\n"
    "    void TermGenerator.stopper=()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_documente___(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","set_document", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","set_document", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      (arg1)->set_document((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_document(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Document *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator const *","get_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    try {
      result = (Xapian::Document *) &((Xapian::TermGenerator const *)arg1)->get_document();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Document, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_databasee___(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::WritableDatabase *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_database", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__WritableDatabase,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const &","set_database", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::WritableDatabase const &","set_database", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::WritableDatabase * >(argp2);
  {
    try {
      (arg1)->set_database((Xapian::WritableDatabase const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_set_flags__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  Xapian::TermGenerator::flags arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Xapian::TermGenerator::flags result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_flags", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::TermGenerator::flags","set_flags", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::TermGenerator::flags >(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::TermGenerator::flags","set_flags", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::TermGenerator::flags >(val3);
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_set_flags__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Xapian::TermGenerator::flags result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_flags", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::TermGenerator::flags","set_flags", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::TermGenerator::flags >(val2);
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_TermGenerator_set_flags(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_TermGenerator_set_flags__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_TermGenerator_set_flags__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "TermGenerator.set_flags", 
    "    Xapian::TermGenerator::flags TermGenerator.set_flags(Xapian::TermGenerator::flags toggle, Xapian::TermGenerator::flags mask)\n"
    "    Xapian::TermGenerator::flags TermGenerator.set_flags(Xapian::TermGenerator::flags toggle)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_stemming_strategye___(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::stem_strategy arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_stemming_strategy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::TermGenerator::stem_strategy","set_stemming_strategy", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::TermGenerator::stem_strategy >(val2);
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_set_stopper_strategy(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::stop_strategy arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_stopper_strategy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::TermGenerator::stop_strategy","set_stopper_strategy", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::TermGenerator::stop_strategy >(val2);
  {
    try {
      (arg1)->set_stopper_strategy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_set_max_word_length(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  unsigned int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_max_word_length", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","set_max_word_length", 2, argv[0] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  {
    try {
      (arg1)->set_max_word_length(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","index_text", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    std::string *ptr = (std::string *)0;
    res4 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const &","index_text", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","index_text", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->index_text((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_TermGenerator_index_text(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_TermGenerator_index_text__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_TermGenerator_index_text__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_TermGenerator_index_text__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "TermGenerator.index_text", 
    "    void TermGenerator.index_text(std::string const &text, Xapian::termcount wdf_inc, std::string const &prefix)\n"
    "    void TermGenerator.index_text(std::string const &text, Xapian::termcount wdf_inc)\n"
    "    void TermGenerator.index_text(std::string const &text)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text_without_positions__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text_without_positions", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text_without_positions", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text_without_positions", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","index_text_without_positions", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    std::string *ptr = (std::string *)0;
    res4 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const &","index_text_without_positions", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text_without_positions", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text_without_positions__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text_without_positions", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text_without_positions", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text_without_positions", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","index_text_without_positions", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_index_text_without_positions__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","index_text_without_positions", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","index_text_without_positions", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","index_text_without_positions", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_TermGenerator_index_text_without_positions(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_TermGenerator_index_text_without_positions__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_TermGenerator_index_text_without_positions__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_TermGenerator_index_text_without_positions__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "TermGenerator.index_text_without_positions", 
    "    void TermGenerator.index_text_without_positions(std::string const &text, Xapian::termcount wdf_inc, std::string const &prefix)\n"
    "    void TermGenerator.index_text_without_positions(std::string const &text, Xapian::termcount wdf_inc)\n"
    "    void TermGenerator.index_text_without_positions(std::string const &text)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_increase_termpos__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termpos arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","increase_termpos", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termpos","increase_termpos", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termpos >(val2);
  {
    try {
      (arg1)->increase_termpos(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_increase_termpos__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","increase_termpos", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    try {
      (arg1)->increase_termpos();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_TermGenerator_increase_termpos(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_TermGenerator_increase_termpos__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermGenerator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_TermGenerator_increase_termpos__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "TermGenerator.increase_termpos", 
    "    void TermGenerator.increase_termpos(Xapian::termpos delta)\n"
    "    void TermGenerator.increase_termpos()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_termpos(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termpos result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator const *","get_termpos", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    try {
      result = (Xapian::termpos)((Xapian::TermGenerator const *)arg1)->get_termpos();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_set_termpos(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termpos arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator *","set_termpos", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termpos","set_termpos", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termpos >(val2);
  {
    try {
      (arg1)->set_termpos(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TermGenerator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TermGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TermGenerator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TermGenerator * >(argp1);
  {
    try {
      result = ((Xapian::TermGenerator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassMSet;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_MSet_allocate(VALUE self)
#else
_wrap_MSet_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__MSet);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_MSet(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::MSet";
  Xapian::MSet *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_MSet(void *self) {
    Xapian::MSet *arg1 = (Xapian::MSet *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_MSet_convert_to_percent__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","convert_to_percent", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","convert_to_percent", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      result = (int)((Xapian::MSet const *)arg1)->convert_to_percent(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_convert_to_percent__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","convert_to_percent", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","convert_to_percent", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","convert_to_percent", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (int)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_MSet_convert_to_percent(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_MSet_convert_to_percent__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MSet_convert_to_percent__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "MSet.convert_to_percent", 
    "    int MSet.convert_to_percent(double weight)\n"
    "    int MSet.convert_to_percent(Xapian::MSetIterator const &it)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_termfreq(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_termfreq", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_termfreq", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_termfreq", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_termweight(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_termweight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_termweight", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_termweight", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (double)((Xapian::MSet const *)arg1)->get_termweight((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_firstitem(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_firstitem", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_firstitem();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_matches_lower_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_matches_lower_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_lower_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_matches_estimated(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_matches_estimated", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_estimated();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_matches_upper_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_matches_upper_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_upper_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_get_uncollapsed_matches_lower_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_uncollapsed_matches_lower_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_lower_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_get_uncollapsed_matches_estimated(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_uncollapsed_matches_estimated", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_estimated();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_get_uncollapsed_matches_upper_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_uncollapsed_matches_upper_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_upper_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_max_attained(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_max_attained", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (double)((Xapian::MSet const *)arg1)->get_max_attained();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_max_possible(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_max_possible", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (double)((Xapian::MSet const *)arg1)->get_max_possible();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  std::string *arg7 = 0 ;
  std::string *arg8 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 ;
  int res4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  int res6 = SWIG_OLDOBJ ;
  int res7 = SWIG_OLDOBJ ;
  int res8 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 7) || (argc > 7)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::Stem const &","snippet", 4, argv[2] )); 
  }
  if (!argp4) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","snippet", 4, argv[2])); 
  }
  arg4 = reinterpret_cast< Xapian::Stem * >(argp4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","snippet", 5, argv[3] ));
  } 
  arg5 = static_cast< unsigned int >(val5);
  {
    std::string *ptr = (std::string *)0;
    res6 = SWIG_AsPtr_std_string(argv[4], &ptr);
    if (!SWIG_IsOK(res6)) {
      SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "std::string const &","snippet", 6, argv[4] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 6, argv[4])); 
    }
    arg6 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res7 = SWIG_AsPtr_std_string(argv[5], &ptr);
    if (!SWIG_IsOK(res7)) {
      SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "std::string const &","snippet", 7, argv[5] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 7, argv[5])); 
    }
    arg7 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res8 = SWIG_AsPtr_std_string(argv[6], &ptr);
    if (!SWIG_IsOK(res8)) {
      SWIG_exception_fail(SWIG_ArgError(res8), Ruby_Format_TypeError( "", "std::string const &","snippet", 8, argv[6] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 8, argv[6])); 
    }
    arg8 = ptr;
  }
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  if (SWIG_IsNewObj(res8)) delete arg8;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  if (SWIG_IsNewObj(res8)) delete arg8;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  std::string *arg7 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 ;
  int res4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  int res6 = SWIG_OLDOBJ ;
  int res7 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::Stem const &","snippet", 4, argv[2] )); 
  }
  if (!argp4) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","snippet", 4, argv[2])); 
  }
  arg4 = reinterpret_cast< Xapian::Stem * >(argp4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","snippet", 5, argv[3] ));
  } 
  arg5 = static_cast< unsigned int >(val5);
  {
    std::string *ptr = (std::string *)0;
    res6 = SWIG_AsPtr_std_string(argv[4], &ptr);
    if (!SWIG_IsOK(res6)) {
      SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "std::string const &","snippet", 6, argv[4] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 6, argv[4])); 
    }
    arg6 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res7 = SWIG_AsPtr_std_string(argv[5], &ptr);
    if (!SWIG_IsOK(res7)) {
      SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "std::string const &","snippet", 7, argv[5] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 7, argv[5])); 
    }
    arg7 = ptr;
  }
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6,(std::string const &)*arg7);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  if (SWIG_IsNewObj(res7)) delete arg7;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  std::string *arg6 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 ;
  int res4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  int res6 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::Stem const &","snippet", 4, argv[2] )); 
  }
  if (!argp4) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","snippet", 4, argv[2])); 
  }
  arg4 = reinterpret_cast< Xapian::Stem * >(argp4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","snippet", 5, argv[3] ));
  } 
  arg5 = static_cast< unsigned int >(val5);
  {
    std::string *ptr = (std::string *)0;
    res6 = SWIG_AsPtr_std_string(argv[4], &ptr);
    if (!SWIG_IsOK(res6)) {
      SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "std::string const &","snippet", 6, argv[4] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 6, argv[4])); 
    }
    arg6 = ptr;
  }
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5,(std::string const &)*arg6);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res6)) delete arg6;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  unsigned int arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 ;
  int res4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::Stem const &","snippet", 4, argv[2] )); 
  }
  if (!argp4) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","snippet", 4, argv[2])); 
  }
  arg4 = reinterpret_cast< Xapian::Stem * >(argp4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","snippet", 5, argv[3] ));
  } 
  arg5 = static_cast< unsigned int >(val5);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4,arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Stem *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 ;
  int res4 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::Stem const &","snippet", 4, argv[2] )); 
  }
  if (!argp4) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","snippet", 4, argv[2])); 
  }
  arg4 = reinterpret_cast< Xapian::Stem * >(argp4);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3,(Xapian::Stem const &)*arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","snippet", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_snippet__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","snippet", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","snippet", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","snippet", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::MSet const *)arg1)->snippet((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_MSet_snippet(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[9];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 9) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_MSet_snippet__SWIG_6(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MSet_snippet__SWIG_5(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__Stem, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_MSet_snippet__SWIG_4(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__Stem, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_MSet_snippet__SWIG_3(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__Stem, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                return _wrap_MSet_snippet__SWIG_2(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__Stem, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0));
                _v = SWIG_CheckState(res);
                if (_v) {
                  return _wrap_MSet_snippet__SWIG_1(nargs, args, self);
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 8) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__Stem, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0));
                _v = SWIG_CheckState(res);
                if (_v) {
                  int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0));
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    return _wrap_MSet_snippet__SWIG_0(nargs, args, self);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 9, "MSet.snippet", 
    "    std::string MSet.snippet(std::string const &text, size_t length, Xapian::Stem const &stemmer, unsigned int flags, std::string const &hi_start, std::string const &hi_end, std::string const &omit)\n"
    "    std::string MSet.snippet(std::string const &text, size_t length, Xapian::Stem const &stemmer, unsigned int flags, std::string const &hi_start, std::string const &hi_end)\n"
    "    std::string MSet.snippet(std::string const &text, size_t length, Xapian::Stem const &stemmer, unsigned int flags, std::string const &hi_start)\n"
    "    std::string MSet.snippet(std::string const &text, size_t length, Xapian::Stem const &stemmer, unsigned int flags)\n"
    "    std::string MSet.snippet(std::string const &text, size_t length, Xapian::Stem const &stemmer)\n"
    "    std::string MSet.snippet(std::string const &text, size_t length)\n"
    "    std::string MSet.snippet(std::string const &text)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_fetch__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","fetch", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","fetch", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","fetch", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","fetch", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","fetch", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::MSetIterator * >(argp3);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch((Xapian::MSetIterator const &)*arg2,(Xapian::MSetIterator const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_fetch__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","fetch", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","fetch", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","fetch", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_fetch__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","fetch", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_MSet_fetch(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_MSet_fetch__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_MSet_fetch__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_MSet_fetch__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "MSet.fetch", 
    "    void MSet.fetch(Xapian::MSetIterator const &begin, Xapian::MSetIterator const &end)\n"
    "    void MSet.fetch(Xapian::MSetIterator const &item)\n"
    "    void MSet.fetch()\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::MSet.size

  call-seq:
    size -> Xapian::doccount

Size or Length of the MSet.
*/
SWIGINTERN VALUE
_wrap_MSet_size(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::MSet.empty

  call-seq:
    empty -> bool

Check if the MSet is empty or not.
*/
SWIGINTERN VALUE
_wrap_MSet_emptyq___(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","empty", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (bool)((Xapian::MSet const *)arg1)->empty();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::MSet._begin

  call-seq:
    _begin -> MSetIterator

Return an iterator to the beginning of the MSet.
*/
SWIGINTERN VALUE
_wrap_MSet__begin(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::MSetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::MSet._end

  call-seq:
    _end -> MSetIterator

Return an iterator to past the end of the MSet.
*/
SWIGINTERN VALUE
_wrap_MSet__end(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::MSetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::MSet._back

  call-seq:
    _back -> MSetIterator

Return the last element in MSet.
*/
SWIGINTERN VALUE
_wrap_MSet__back(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::MSetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","back", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->back();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_description(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_docid", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_docid((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_document(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::Document result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = Xapian_MSet_get_document((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_hit(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::MSetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_hit", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_hit", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = Xapian_MSet_get_hit((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSet_document_percentage(int argc, VALUE *argv, VALUE self) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSet const *","get_document_percentage", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_document_percentage", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = (int)Xapian_MSet_get_document_percentage((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassMSetIterator;

SWIGINTERN VALUE
_wrap_MSetIterator_mset_set(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet *arg2 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSet *","mset", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::MSet * >(argp2);
  if (arg1) (arg1)->mset = *arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_mset_get(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::MSet *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  result = (Xapian::MSet *)& ((arg1)->mset);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_off_from_end_set(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSet::size_type arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","off_from_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::MSet::size_type","off_from_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::MSet::size_type >(val2);
  if (arg1) (arg1)->off_from_end = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_off_from_end_get(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::MSet::size_type result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","off_from_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  result = (Xapian::MSet::size_type) ((arg1)->off_from_end);
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_MSetIterator_allocate(VALUE self)
#else
_wrap_MSetIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__MSetIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_MSetIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::MSetIterator";
  Xapian::MSetIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_rank(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_rank", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_rank();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_document(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Document result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_document();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (double)((Xapian::MSetIterator const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_get_collapse_key(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_collapse_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_collapse_key();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_collapse_count(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_collapse_count", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_collapse_count();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_get_sort_key(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_sort_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_sort_key();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_percent(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_percent", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (int)((Xapian::MSetIterator const *)arg1)->get_percent();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::docid)Xapian_MSetIterator_get_docid((Xapian::MSetIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MSetIterator_prev(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator *","prev", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_MSetIterator(void *self) {
    Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *)self;
    delete arg1;
}


/*
  Document-method: Xapian::Xapian.==

  call-seq:
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap___eq____SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::MSetIterator const &)*arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.<

  call-seq:
    <(a, b) -> bool
    <(a, b) -> bool

Lower than comparison operator.
*/
SWIGINTERN VALUE
_wrap___lt____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator <", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator <", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator <", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator <", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator <((Xapian::MSetIterator const &)*arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.>

  call-seq:
    >(a, b) -> bool
    >(a, b) -> bool

Higher than comparison operator.
*/
SWIGINTERN VALUE
_wrap___gt____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator >", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator >", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator >", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator >", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator >((Xapian::MSetIterator const &)*arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.>=

  call-seq:
    >=(a, b) -> bool
    >=(a, b) -> bool

Higher or equal comparison operator.
*/
SWIGINTERN VALUE
_wrap___ge____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator >=", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator >=", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator >=", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator >=", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator >=((Xapian::MSetIterator const &)*arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.<=

  call-seq:
    <=(a, b) -> bool
    <=(a, b) -> bool

Lower or equal comparison operator.
*/
SWIGINTERN VALUE
_wrap___le____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator <=", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator <=", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator <=", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator <=", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator <=((Xapian::MSetIterator const &)*arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.+

  call-seq:
    +(n, it) -> MSetIterator
    +(n, it) -> ESetIterator

Add operator.
*/
SWIGINTERN VALUE
_wrap___add____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MSetIterator::difference_type arg1 ;
  Xapian::MSetIterator *arg2 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::MSetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::MSetIterator::difference_type","Xapian::operator +", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::MSetIterator::difference_type >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","Xapian::operator +", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","Xapian::operator +", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = Xapian::operator +(arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassESet;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ESet_allocate(VALUE self)
#else
_wrap_ESet_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ESet);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ESet(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::ESet";
  Xapian::ESet *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ESet(void *self) {
    Xapian::ESet *arg1 = (Xapian::ESet *)self;
    delete arg1;
}


/*
  Document-method: Xapian::ESet.size

  call-seq:
    size -> Xapian::doccount

Size or Length of the ESet.
*/
SWIGINTERN VALUE
_wrap_ESet_size(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::ESet const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ESet.empty

  call-seq:
    empty -> bool

Check if the ESet is empty or not.
*/
SWIGINTERN VALUE
_wrap_ESet_emptyq___(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","empty", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (bool)((Xapian::ESet const *)arg1)->empty();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESet_ebound(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","get_ebound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->get_ebound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ESet._begin

  call-seq:
    _begin -> ESetIterator

Return an iterator to the beginning of the ESet.
*/
SWIGINTERN VALUE
_wrap_ESet__begin(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ESetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ESet._end

  call-seq:
    _end -> ESetIterator

Return an iterator to past the end of the ESet.
*/
SWIGINTERN VALUE
_wrap_ESet__end(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ESetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::ESet._back

  call-seq:
    _back -> ESetIterator

Return the last element in ESet.
*/
SWIGINTERN VALUE
_wrap_ESet__back(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ESetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","back", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->back();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESet_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESet const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassESetIterator;

SWIGINTERN VALUE
_wrap_ESetIterator_eset_set(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet *arg2 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESet *","eset", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::ESet * >(argp2);
  if (arg1) (arg1)->eset = *arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_eset_get(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ESet *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  result = (Xapian::ESet *)& ((arg1)->eset);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_off_from_end_set(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESet::size_type arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","off_from_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::ESet::size_type","off_from_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::ESet::size_type >(val2);
  if (arg1) (arg1)->off_from_end = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_off_from_end_get(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::ESet::size_type result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","off_from_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  result = (Xapian::ESet::size_type) ((arg1)->off_from_end);
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ESetIterator_allocate(VALUE self)
#else
_wrap_ESetIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ESetIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ESetIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::ESetIterator";
  Xapian::ESetIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = (double)((Xapian::ESetIterator const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = ((Xapian::ESetIterator const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_term(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const *","get_term", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = Xapian_ESetIterator_get_term((Xapian::ESetIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ESetIterator_prev(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator *","prev", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ESetIterator(void *self) {
    Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *)self;
    delete arg1;
}


/*
  Document-method: Xapian::Xapian.==

  call-seq:
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool
    ==(a, b) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap___eq____SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator ==", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator ==", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator ==", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator ==", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator ==((Xapian::ESetIterator const &)*arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___eq__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__PositionIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__PositionIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__PostingIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__PostingIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__TermIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ValueIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ValueIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_3(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_4(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___eq____SWIG_5(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__eq__", 
    "    bool __eq__(Xapian::PositionIterator const &a, Xapian::PositionIterator const &b)\n"
    "    bool __eq__(Xapian::PostingIterator const &a, Xapian::PostingIterator const &b)\n"
    "    bool __eq__(Xapian::TermIterator const &a, Xapian::TermIterator const &b)\n"
    "    bool __eq__(Xapian::ValueIterator const &a, Xapian::ValueIterator const &b)\n"
    "    bool __eq__(Xapian::MSetIterator const &a, Xapian::MSetIterator const &b)\n"
    "    bool __eq__(Xapian::ESetIterator const &a, Xapian::ESetIterator const &b)\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.<

  call-seq:
    <(a, b) -> bool
    <(a, b) -> bool

Lower than comparison operator.
*/
SWIGINTERN VALUE
_wrap___lt____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator <", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator <", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator <", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator <", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator <((Xapian::ESetIterator const &)*arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___lt__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___lt____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___lt____SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__lt__", 
    "    bool __lt__(Xapian::MSetIterator const &a, Xapian::MSetIterator const &b)\n"
    "    bool __lt__(Xapian::ESetIterator const &a, Xapian::ESetIterator const &b)\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.>

  call-seq:
    >(a, b) -> bool
    >(a, b) -> bool

Higher than comparison operator.
*/
SWIGINTERN VALUE
_wrap___gt____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator >", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator >", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator >", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator >", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator >((Xapian::ESetIterator const &)*arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___gt__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___gt____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___gt____SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__gt__", 
    "    bool __gt__(Xapian::MSetIterator const &a, Xapian::MSetIterator const &b)\n"
    "    bool __gt__(Xapian::ESetIterator const &a, Xapian::ESetIterator const &b)\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.>=

  call-seq:
    >=(a, b) -> bool
    >=(a, b) -> bool

Higher or equal comparison operator.
*/
SWIGINTERN VALUE
_wrap___ge____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator >=", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator >=", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator >=", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator >=", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator >=((Xapian::ESetIterator const &)*arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___ge__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___ge____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___ge____SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__ge__", 
    "    bool __ge__(Xapian::MSetIterator const &a, Xapian::MSetIterator const &b)\n"
    "    bool __ge__(Xapian::ESetIterator const &a, Xapian::ESetIterator const &b)\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.<=

  call-seq:
    <=(a, b) -> bool
    <=(a, b) -> bool

Lower or equal comparison operator.
*/
SWIGINTERN VALUE
_wrap___le____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator <=", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator <=", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator <=", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator <=", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian::operator <=((Xapian::ESetIterator const &)*arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___le__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___le____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___le____SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__le__", 
    "    bool __le__(Xapian::MSetIterator const &a, Xapian::MSetIterator const &b)\n"
    "    bool __le__(Xapian::ESetIterator const &a, Xapian::ESetIterator const &b)\n");
  
  return Qnil;
}



/*
  Document-method: Xapian::Xapian.+

  call-seq:
    +(n, it) -> MSetIterator
    +(n, it) -> ESetIterator

Add operator.
*/
SWIGINTERN VALUE
_wrap___add____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::ESetIterator::difference_type arg1 ;
  Xapian::ESetIterator *arg2 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::ESetIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::ESetIterator::difference_type","Xapian::operator +", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::ESetIterator::difference_type >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ESetIterator const &","Xapian::operator +", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ESetIterator const &","Xapian::operator +", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = Xapian::operator +(arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap___add__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___add____SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap___add____SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "__add__", 
    "    Xapian::MSetIterator __add__(Xapian::MSetIterator::difference_type n, Xapian::MSetIterator const &it)\n"
    "    Xapian::ESetIterator __add__(Xapian::ESetIterator::difference_type n, Xapian::ESetIterator const &it)\n");
  
  return Qnil;
}


static swig_class SwigClassRSet;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_RSet_allocate(VALUE self)
#else
_wrap_RSet_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__RSet);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_RSet(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::RSet";
  Xapian::RSet *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_RSet(void *self) {
    Xapian::RSet *arg1 = (Xapian::RSet *)self;
    delete arg1;
}


/*
  Document-method: Xapian::RSet.size

  call-seq:
    size -> Xapian::doccount

Size or Length of the RSet.
*/
SWIGINTERN VALUE
_wrap_RSet_size(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::RSet const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::RSet.empty

  call-seq:
    empty -> bool

Check if the RSet is empty or not.
*/
SWIGINTERN VALUE
_wrap_RSet_emptyq___(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet const *","empty", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->empty();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_add_document__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet *","add_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","add_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->add_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_add_document__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet *","add_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","add_document", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","add_document", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      (arg1)->add_document((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_RSet_add_document(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_RSet_add_document__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_add_document__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "RSet.add_document", 
    "    void RSet.add_document(Xapian::docid did)\n"
    "    void RSet.add_document(Xapian::MSetIterator const &i)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_remove_document__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet *","remove_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","remove_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->remove_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_remove_document__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet *","remove_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","remove_document", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","remove_document", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      (arg1)->remove_document((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_RSet_remove_document(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_RSet_remove_document__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_remove_document__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "RSet.remove_document", 
    "    void RSet.remove_document(Xapian::docid did)\n"
    "    void RSet.remove_document(Xapian::MSetIterator const &i)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_contains__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet const *","contains", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","contains", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->contains(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_contains__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet const *","contains", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","contains", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","contains", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->contains((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_RSet_contains(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_RSet_contains__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_contains__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "RSet.contains", 
    "    bool RSet.contains(Xapian::docid did)\n"
    "    bool RSet.contains(Xapian::MSetIterator const &i)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RSet_description(int argc, VALUE *argv, VALUE self) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RSet const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = ((Xapian::RSet const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassMatchDecider;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_MatchDecider_allocate(VALUE self)
#else
_wrap_MatchDecider_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__MatchDecider);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_MatchDecider(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::MatchDecider";
  Xapian::MatchDecider *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::MatchDecider *)new SwigDirector_MatchDecider(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MatchDecider___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchDecider const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchDecider * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::MatchDecider::operator ()");
        } else {
          result = (bool)((Xapian::MatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_MatchDecider(void *self) {
    Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_disown_MatchDecider(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchDecider *","disown_MatchDecider", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchDecider * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassEnquire;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Enquire_allocate(VALUE self)
#else
_wrap_Enquire_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Enquire);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Enquire(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Enquire";
  Xapian::Enquire *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const &","Enquire", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","Enquire", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_Enquire(void *self) {
    Xapian::Enquire *arg1 = (Xapian::Enquire *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Enquire_queryN___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Query const &","set_query", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","set_query", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","set_query", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_querye___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Query const &","set_query", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Query const &","set_query", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_query(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Query *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      result = (Xapian::Query *) &((Xapian::Enquire const *)arg1)->get_query();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Query, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_add_matchspy(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MatchSpy *arg2 = (Xapian::MatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","add_matchspy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MatchSpy *","add_matchspy", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::MatchSpy * >(argp2);
  {
    try {
      (arg1)->add_matchspy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_clear_matchspies(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","clear_matchspies", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      (arg1)->clear_matchspies();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_weighting_schemee___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_weighting_scheme", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Weight,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Weight const &","set_weighting_scheme", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Weight const &","set_weighting_scheme", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Weight * >(argp2);
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_expansion_scheme__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","set_expansion_scheme", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_expansion_scheme", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_expansion_scheme", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","set_expansion_scheme", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      ((Xapian::Enquire const *)arg1)->set_expansion_scheme((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_expansion_scheme__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","set_expansion_scheme", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_expansion_scheme", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_expansion_scheme", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      ((Xapian::Enquire const *)arg1)->set_expansion_scheme((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire_set_expansion_scheme(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Enquire_set_expansion_scheme__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_expansion_scheme__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Enquire.set_expansion_scheme", 
    "    void Enquire.set_expansion_scheme(std::string const &eweightname_, double expand_k_)\n"
    "    void Enquire.set_expansion_scheme(std::string const &eweightname_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_collapse_keye_____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::doccount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_collapse_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","set_collapse_key", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","set_collapse_key", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  {
    try {
      (arg1)->set_collapse_key(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_collapse_keye_____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_collapse_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","set_collapse_key", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire_collapse_keye___(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_collapse_keye_____SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_collapse_keye_____SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Enquire.collapse_key=", 
    "    void Enquire.collapse_key=(Xapian::valueno collapse_key, Xapian::doccount collapse_max)\n"
    "    void Enquire.collapse_key=(Xapian::valueno collapse_key)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_docid_ordere___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_docid_order", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Enquire::docid_order","set_docid_order", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::Enquire::docid_order >(val2);
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_cutoffN_____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_cutoff", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","set_cutoff", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","set_cutoff", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_cutoffN_____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_cutoff", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","set_cutoff", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      (arg1)->set_cutoff(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire_cutoffN___(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_cutoffN_____SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_cutoffN_____SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Enquire.cutoff!", 
    "    void Enquire.cutoff!(int percent_cutoff, double weight_cutoff)\n"
    "    void Enquire.cutoff!(int percent_cutoff)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_sort_by_relevanceN___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_relevance", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      (arg1)->set_sort_by_relevance();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_sort_by_valueN___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","set_sort_by_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_value", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_sort_by_key(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::KeyMaker *","set_sort_by_key", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::KeyMaker * >(argp2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_key", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_key(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_sort_by_value_then_relevanceN___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_value_then_relevance", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","set_sort_by_value_then_relevance", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_value_then_relevance", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_sort_by_key_then_relevance(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_key_then_relevance", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::KeyMaker *","set_sort_by_key_then_relevance", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::KeyMaker * >(argp2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_key_then_relevance", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_key_then_relevance(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_sort_by_relevance_then_valueN___(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_relevance_then_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","set_sort_by_relevance_then_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_relevance_then_value", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_sort_by_relevance_then_key(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_sort_by_relevance_then_key", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::KeyMaker *","set_sort_by_relevance_then_key", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::KeyMaker * >(argp2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","set_sort_by_relevance_then_key", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_relevance_then_key(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_set_time_limit(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire *","set_time_limit", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","set_time_limit", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->set_time_limit(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_0(int argc, VALUE *argv, VALUE self) {
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  void *argp6 = 0 ;
  int res6 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::RSet const *","get_mset", 5, argv[3] )); 
  }
  arg5 = reinterpret_cast< Xapian::RSet * >(argp5);
  res6 = SWIG_ConvertPtr(argv[4], &argp6,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "Xapian::MatchDecider const *","get_mset", 6, argv[4] )); 
  }
  arg6 = reinterpret_cast< Xapian::MatchDecider * >(argp6);
  {
    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);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::RSet const *","get_mset", 5, argv[3] )); 
  }
  arg5 = reinterpret_cast< Xapian::RSet * >(argp5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg5 = (Xapian::MatchDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::RSet const *","get_mset", 4, argv[2] )); 
  }
  arg4 = reinterpret_cast< Xapian::RSet * >(argp4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::MatchDecider const *","get_mset", 5, argv[3] )); 
  }
  arg5 = reinterpret_cast< Xapian::MatchDecider * >(argp5);
  {
    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);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_mset__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  Xapian::MSet result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_mset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::doccount","get_mset", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::RSet const *","get_mset", 4, argv[2] )); 
  }
  arg4 = reinterpret_cast< Xapian::RSet * >(argp4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire_mset(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[7];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 7) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_mset__SWIG_3(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_Enquire_mset__SWIG_5(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Enquire_mset__SWIG_2(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__MatchDecider, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              return _wrap_Enquire_mset__SWIG_4(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              return _wrap_Enquire_mset__SWIG_1(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              void *vptr = 0;
              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_Xapian__MatchDecider, 0);
              _v = SWIG_CheckState(res);
              if (_v) {
                return _wrap_Enquire_mset__SWIG_0(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 7, "Enquire.mset", 
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast, Xapian::RSet const *omrset, Xapian::MatchDecider const *mdecider)\n"
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast, Xapian::RSet const *omrset)\n"
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast)\n"
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems)\n"
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::RSet const *omrset, Xapian::MatchDecider const *mdecider)\n"
    "    Xapian::MSet Enquire.mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::RSet const *omrset)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ExpandDecider *arg5 = (Xapian::ExpandDecider *) 0 ;
  double arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","get_eset", 5, argv[3] )); 
  }
  arg5 = reinterpret_cast< Xapian::ExpandDecider * >(argp5);
  ecode6 = SWIG_AsVal_double(argv[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","get_eset", 6, argv[4] ));
  } 
  arg6 = static_cast< double >(val6);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,(Xapian::ExpandDecider const *)arg5,arg6);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ExpandDecider *arg5 = (Xapian::ExpandDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","get_eset", 5, argv[3] )); 
  }
  arg5 = reinterpret_cast< Xapian::ExpandDecider * >(argp5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,(Xapian::ExpandDecider const *)arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ExpandDecider *arg4 = (Xapian::ExpandDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","get_eset", 4, argv[2] )); 
  }
  arg4 = reinterpret_cast< Xapian::ExpandDecider * >(argp4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,(Xapian::ExpandDecider const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  double arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  void *argp6 = 0 ;
  int res6 = 0 ;
  double val7 ;
  int ecode7 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_double(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","get_eset", 5, argv[3] ));
  } 
  arg5 = static_cast< double >(val5);
  res6 = SWIG_ConvertPtr(argv[4], &argp6,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","get_eset", 6, argv[4] )); 
  }
  arg6 = reinterpret_cast< Xapian::ExpandDecider * >(argp6);
  ecode7 = SWIG_AsVal_double(argv[5], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","get_eset", 7, argv[5] ));
  } 
  arg7 = static_cast< double >(val7);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6,arg7);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  void *argp6 = 0 ;
  int res6 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_double(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","get_eset", 5, argv[3] ));
  } 
  arg5 = static_cast< double >(val5);
  res6 = SWIG_ConvertPtr(argv[4], &argp6,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","get_eset", 6, argv[4] )); 
  }
  arg6 = reinterpret_cast< Xapian::ExpandDecider * >(argp6);
  {
    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);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_eset__SWIG_7(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  Xapian::ESet result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_eset", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_eset", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::RSet const &","get_eset", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::RSet const &","get_eset", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","get_eset", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_double(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","get_eset", 5, argv[3] ));
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire_eset(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[8];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 8) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Enquire_eset__SWIG_3(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Xapian__ExpandDecider, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_Enquire_eset__SWIG_4(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Enquire_eset__SWIG_2(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__ExpandDecider, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              return _wrap_Enquire_eset__SWIG_1(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_Enquire_eset__SWIG_7(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__ExpandDecider, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              {
                int res = SWIG_AsVal_double(argv[5], NULL);
                _v = SWIG_CheckState(res);
              }
              if (_v) {
                return _wrap_Enquire_eset__SWIG_0(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              void *vptr = 0;
              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_Xapian__ExpandDecider, 0);
              _v = SWIG_CheckState(res);
              if (_v) {
                return _wrap_Enquire_eset__SWIG_6(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              void *vptr = 0;
              int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_Xapian__ExpandDecider, 0);
              _v = SWIG_CheckState(res);
              if (_v) {
                {
                  int res = SWIG_AsVal_double(argv[6], NULL);
                  _v = SWIG_CheckState(res);
                }
                if (_v) {
                  return _wrap_Enquire_eset__SWIG_5(nargs, args, self);
                }
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 8, "Enquire.eset", 
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &omrset, int flags, Xapian::ExpandDecider const *edecider, double min_wt)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &omrset, int flags, Xapian::ExpandDecider const *edecider)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &omrset, int flags)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &omrset)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &omrset, Xapian::ExpandDecider const *edecider)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &rset, int flags, double k, Xapian::ExpandDecider const *edecider, double min_wt)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &rset, int flags, double k, Xapian::ExpandDecider const *edecider)\n"
    "    Xapian::ESet Enquire.eset(Xapian::termcount maxitems, Xapian::RSet const &rset, int flags, double k)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire__dangerous_matching_terms_begin__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_matching_terms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_matching_terms_begin", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire__dangerous_matching_terms_end__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_matching_terms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_matching_terms_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire__dangerous_matching_terms_begin__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_matching_terms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","get_matching_terms_begin", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","get_matching_terms_begin", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire__dangerous_matching_terms_begin(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Enquire__dangerous_matching_terms_begin__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire__dangerous_matching_terms_begin__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Enquire._dangerous_matching_terms_begin", 
    "    Xapian::TermIterator Enquire._dangerous_matching_terms_begin(Xapian::docid did)\n"
    "    Xapian::TermIterator Enquire._dangerous_matching_terms_begin(Xapian::MSetIterator const &it)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire__dangerous_matching_terms_end__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_matching_terms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::MSetIterator const &","get_matching_terms_end", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::MSetIterator const &","get_matching_terms_end", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Enquire__dangerous_matching_terms_end(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Enquire__dangerous_matching_terms_end__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Enquire, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire__dangerous_matching_terms_end__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Enquire._dangerous_matching_terms_end", 
    "    Xapian::TermIterator Enquire._dangerous_matching_terms_end(Xapian::docid)\n"
    "    Xapian::TermIterator Enquire._dangerous_matching_terms_end(Xapian::MSetIterator const &)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Enquire_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Enquire const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassExpandDecider;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ExpandDecider_allocate(VALUE self)
#else
_wrap_ExpandDecider_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ExpandDecider);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ExpandDecider(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::ExpandDecider";
  Xapian::ExpandDecider *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::ExpandDecider *)new SwigDirector_ExpandDecider(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ExpandDecider___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDecider * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::ExpandDecider::operator ()");
        } else {
          result = (bool)((Xapian::ExpandDecider const *)arg1)->operator ()((std::string const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN void
free_Xapian_ExpandDecider(void *self) {
    Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_ExpandDecider_release(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::ExpandDecider *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDecider * >(argp1);
  {
    try {
      result = (Xapian::ExpandDecider *)((Xapian::ExpandDecider const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_ExpandDecider(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDecider *","disown_ExpandDecider", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDecider * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassExpandDeciderAnd;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ExpandDeciderAnd_allocate(VALUE self)
#else
_wrap_ExpandDeciderAnd_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ExpandDeciderAnd);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ExpandDeciderAnd(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDecider *arg1 = 0 ;
  Xapian::ExpandDecider *arg2 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ExpandDeciderAnd";
  Xapian::ExpandDeciderAnd *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__ExpandDecider,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const &","ExpandDeciderAnd", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ExpandDecider const &","ExpandDeciderAnd", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDecider * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__ExpandDecider,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ExpandDecider const &","ExpandDeciderAnd", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::ExpandDecider const &","ExpandDeciderAnd", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::ExpandDecider * >(argp2);
  {
    try {
      result = (Xapian::ExpandDeciderAnd *)new Xapian::ExpandDeciderAnd((Xapian::ExpandDecider const &)*arg1,(Xapian::ExpandDecider const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ExpandDeciderAnd___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDeciderAnd *arg1 = (Xapian::ExpandDeciderAnd *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ExpandDeciderAnd, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDeciderAnd const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDeciderAnd * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (bool)((Xapian::ExpandDeciderAnd const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN void
free_Xapian_ExpandDeciderAnd(void *self) {
    Xapian::ExpandDeciderAnd *arg1 = (Xapian::ExpandDeciderAnd *)self;
    delete arg1;
}

static swig_class SwigClassExpandDeciderFilterPrefix;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ExpandDeciderFilterPrefix_allocate(VALUE self)
#else
_wrap_ExpandDeciderFilterPrefix_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ExpandDeciderFilterPrefix(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::ExpandDeciderFilterPrefix";
  Xapian::ExpandDeciderFilterPrefix *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","ExpandDeciderFilterPrefix", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","ExpandDeciderFilterPrefix", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::ExpandDeciderFilterPrefix *)new Xapian::ExpandDeciderFilterPrefix((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ExpandDeciderFilterPrefix___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ExpandDeciderFilterPrefix *arg1 = (Xapian::ExpandDeciderFilterPrefix *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ExpandDeciderFilterPrefix const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ExpandDeciderFilterPrefix * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (bool)((Xapian::ExpandDeciderFilterPrefix const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN void
free_Xapian_ExpandDeciderFilterPrefix(void *self) {
    Xapian::ExpandDeciderFilterPrefix *arg1 = (Xapian::ExpandDeciderFilterPrefix *)self;
    delete arg1;
}

static swig_class SwigClassKeyMaker;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_KeyMaker_allocate(VALUE self)
#else
_wrap_KeyMaker_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__KeyMaker);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_KeyMaker(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::KeyMaker";
  Xapian::KeyMaker *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::KeyMaker *)new SwigDirector_KeyMaker(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_KeyMaker___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::KeyMaker const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::KeyMaker * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::KeyMaker::operator ()");
        } else {
          result = ((Xapian::KeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_KeyMaker(void *self) {
    Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_KeyMaker_release(int argc, VALUE *argv, VALUE self) {
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::KeyMaker *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::KeyMaker const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::KeyMaker * >(argp1);
  {
    try {
      result = (Xapian::KeyMaker *)((Xapian::KeyMaker const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_KeyMaker(int argc, VALUE *argv, VALUE self) {
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__KeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::KeyMaker *","disown_KeyMaker", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::KeyMaker * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassMultiValueKeyMaker;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_MultiValueKeyMaker_allocate(VALUE self)
#else
_wrap_MultiValueKeyMaker_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__MultiValueKeyMaker);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_MultiValueKeyMaker(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::MultiValueKeyMaker";
  Xapian::MultiValueKeyMaker *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::MultiValueKeyMaker *)new Xapian::MultiValueKeyMaker();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MultiValueKeyMaker___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MultiValueKeyMaker const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MultiValueKeyMaker * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      result = ((Xapian::MultiValueKeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MultiValueKeyMaker_add_value__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  std::string *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MultiValueKeyMaker *","add_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MultiValueKeyMaker * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","add_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","add_value", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    std::string *ptr = (std::string *)0;
    res4 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const &","add_value", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_value", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      (arg1)->add_value(arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MultiValueKeyMaker_add_value__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MultiValueKeyMaker *","add_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MultiValueKeyMaker * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","add_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","add_value", 3, argv[1] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->add_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MultiValueKeyMaker_add_value__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MultiValueKeyMaker *","add_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MultiValueKeyMaker * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","add_value", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->add_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_MultiValueKeyMaker_add_value(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MultiValueKeyMaker_add_value__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MultiValueKeyMaker_add_value__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_MultiValueKeyMaker_add_value__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "MultiValueKeyMaker.add_value", 
    "    void MultiValueKeyMaker.add_value(Xapian::valueno slot, bool reverse, std::string const &defvalue)\n"
    "    void MultiValueKeyMaker.add_value(Xapian::valueno slot, bool reverse)\n"
    "    void MultiValueKeyMaker.add_value(Xapian::valueno slot)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_MultiValueKeyMaker(void *self) {
    Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *)self;
    delete arg1;
}

static swig_class SwigClassStopper;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Stopper_allocate(VALUE self)
#else
_wrap_Stopper_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Stopper);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Stopper(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::Stopper";
  Xapian::Stopper *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::Stopper *)new SwigDirector_Stopper(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Stopper___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stopper const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stopper * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::Stopper::operator ()");
        } else {
          result = (bool)((Xapian::Stopper const *)arg1)->operator ()((std::string const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN void
free_Xapian_Stopper(void *self) {
    Xapian::Stopper *arg1 = (Xapian::Stopper *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Stopper_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stopper const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stopper * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::Stopper const *)arg1)->Xapian::Stopper::get_description();
        } else {
          result = ((Xapian::Stopper const *)arg1)->get_description();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Stopper_release(int argc, VALUE *argv, VALUE self) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::Stopper *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stopper const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Stopper * >(argp1);
  {
    try {
      result = (Xapian::Stopper *)((Xapian::Stopper const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_Stopper(int argc, VALUE *argv, VALUE self) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Stopper *","disown_Stopper", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::Stopper * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassSimpleStopper;

SWIGINTERN VALUE
_wrap_new_SimpleStopper__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::SimpleStopper";
  Xapian::SimpleStopper *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::SimpleStopper *)new Xapian::SimpleStopper();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SimpleStopper_add(int argc, VALUE *argv, VALUE self) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__SimpleStopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::SimpleStopper *","add", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::SimpleStopper * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SimpleStopper___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__SimpleStopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::SimpleStopper const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::SimpleStopper * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (bool)((Xapian::SimpleStopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SimpleStopper_description(int argc, VALUE *argv, VALUE self) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__SimpleStopper, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::SimpleStopper const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::SimpleStopper * >(argp1);
  {
    try {
      result = ((Xapian::SimpleStopper const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_SimpleStopper_allocate(VALUE self)
#else
_wrap_SimpleStopper_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__SimpleStopper);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_SimpleStopper__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::SimpleStopper";
  Xapian::SimpleStopper *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","SimpleStopper", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","SimpleStopper", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::SimpleStopper *)new_Xapian_SimpleStopper__SWIG_2((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_SimpleStopper(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_SimpleStopper__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_SimpleStopper__SWIG_2(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "SimpleStopper.new", 
    "    SimpleStopper.new()\n"
    "    SimpleStopper.new(std::string const &file)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_SimpleStopper(void *self) {
    Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *)self;
    delete arg1;
}

static swig_class SwigClassRangeProcessor;

SWIGINTERN VALUE
_wrap_new_RangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::RangeProcessor";
  Xapian::RangeProcessor *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::RangeProcessor *)new SwigDirector_RangeProcessor(arg1); 
      } else {
        result = (Xapian::RangeProcessor *)new Xapian::RangeProcessor(); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_RangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  unsigned int arg4 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::RangeProcessor";
  Xapian::RangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  arg1 = self;
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","RangeProcessor", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","RangeProcessor", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","RangeProcessor", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","RangeProcessor", 4, argv[2] ));
  } 
  arg4 = static_cast< unsigned int >(val4);
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::RangeProcessor *)new SwigDirector_RangeProcessor(arg1,arg2,(std::string const &)*arg3,arg4); 
      } else {
        result = (Xapian::RangeProcessor *)new Xapian::RangeProcessor(arg2,(std::string const &)*arg3,arg4); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res3)) delete arg3;
  return self;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_RangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::RangeProcessor";
  Xapian::RangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  arg1 = self;
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","RangeProcessor", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","RangeProcessor", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","RangeProcessor", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::RangeProcessor *)new SwigDirector_RangeProcessor(arg1,arg2,(std::string const &)*arg3); 
      } else {
        result = (Xapian::RangeProcessor *)new Xapian::RangeProcessor(arg2,(std::string const &)*arg3); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res3)) delete arg3;
  return self;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_RangeProcessor_allocate(VALUE self)
#else
_wrap_RangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__RangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_RangeProcessor__SWIG_3(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  Xapian::valueno arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::RangeProcessor";
  Xapian::RangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  arg1 = self;
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","RangeProcessor", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::RangeProcessor *)new SwigDirector_RangeProcessor(arg1,arg2); 
      } else {
        result = (Xapian::RangeProcessor *)new Xapian::RangeProcessor(arg2); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_RangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    _v = (argv[0] != 0);
    if (_v) {
      return _wrap_new_RangeProcessor__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    _v = (argv[0] != 0);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_RangeProcessor__SWIG_3(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (argv[0] != 0);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_RangeProcessor__SWIG_2(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = (argv[0] != 0);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_RangeProcessor__SWIG_1(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "RangeProcessor.new", 
    "    RangeProcessor.new()\n"
    "    RangeProcessor.new(Xapian::valueno slot_, std::string const &str_, unsigned int flags_)\n"
    "    RangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n"
    "    RangeProcessor.new(Xapian::valueno slot_)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_RangeProcessor(void *self) {
    Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_RangeProcessor_check_range(int argc, VALUE *argv, VALUE self) {
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RangeProcessor *","check_range", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RangeProcessor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","check_range", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","check_range", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","check_range", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","check_range", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (arg1)->check_range((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RangeProcessor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","operator ()", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->Xapian::RangeProcessor::operator ()((std::string const &)*arg2,(std::string const &)*arg3);
        } else {
          result = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_RangeProcessor_release(int argc, VALUE *argv, VALUE self) {
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::RangeProcessor *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RangeProcessor const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::RangeProcessor * >(argp1);
  {
    try {
      result = (Xapian::RangeProcessor *)((Xapian::RangeProcessor const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_RangeProcessor(int argc, VALUE *argv, VALUE self) {
  Xapian::RangeProcessor *arg1 = (Xapian::RangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::RangeProcessor *","disown_RangeProcessor", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::RangeProcessor * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassDateRangeProcessor;

SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int arg2 ;
  int arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","DateRangeProcessor", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","DateRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int arg2 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","DateRangeProcessor", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","DateRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","DateRangeProcessor", 4, argv[3] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","DateRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_DateRangeProcessor_allocate(VALUE self)
#else
_wrap_DateRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__DateRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_DateRangeProcessor__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::DateRangeProcessor";
  Xapian::DateRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::DateRangeProcessor *)new Xapian::DateRangeProcessor(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_DateRangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs;
  if (argc > 4) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_DateRangeProcessor__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_DateRangeProcessor__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_DateRangeProcessor__SWIG_5(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_DateRangeProcessor__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_DateRangeProcessor__SWIG_4(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_DateRangeProcessor__SWIG_3(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "DateRangeProcessor.new", 
    "    DateRangeProcessor.new(Xapian::valueno slot_, unsigned int flags_, int epoch_year_)\n"
    "    DateRangeProcessor.new(Xapian::valueno slot_, unsigned int flags_)\n"
    "    DateRangeProcessor.new(Xapian::valueno slot_)\n"
    "    DateRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, unsigned int flags_, int epoch_year_)\n"
    "    DateRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, unsigned int flags_)\n"
    "    DateRangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DateRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::DateRangeProcessor *arg1 = (Xapian::DateRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DateRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DateRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DateRangeProcessor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","operator ()", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN void
free_Xapian_DateRangeProcessor(void *self) {
    Xapian::DateRangeProcessor *arg1 = (Xapian::DateRangeProcessor *)self;
    delete arg1;
}

static swig_class SwigClassNumberRangeProcessor;

SWIGINTERN VALUE
_wrap_new_NumberRangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::NumberRangeProcessor";
  Xapian::NumberRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","NumberRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","NumberRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","NumberRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      result = (Xapian::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_NumberRangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::NumberRangeProcessor";
  Xapian::NumberRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","NumberRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","NumberRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_NumberRangeProcessor_allocate(VALUE self)
#else
_wrap_NumberRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__NumberRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_NumberRangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::NumberRangeProcessor";
  Xapian::NumberRangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::NumberRangeProcessor *)new Xapian::NumberRangeProcessor(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_NumberRangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_NumberRangeProcessor__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_NumberRangeProcessor__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_NumberRangeProcessor__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "NumberRangeProcessor.new", 
    "    NumberRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, unsigned int flags_)\n"
    "    NumberRangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n"
    "    NumberRangeProcessor.new(Xapian::valueno slot_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_NumberRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::NumberRangeProcessor *arg1 = (Xapian::NumberRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__NumberRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::NumberRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::NumberRangeProcessor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","operator ()", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (arg1)->operator ()((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN void
free_Xapian_NumberRangeProcessor(void *self) {
    Xapian::NumberRangeProcessor *arg1 = (Xapian::NumberRangeProcessor *)self;
    delete arg1;
}

static swig_class SwigClassValueRangeProcessor;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueRangeProcessor_allocate(VALUE self)
#else
_wrap_ValueRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueRangeProcessor(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValueRangeProcessor";
  Xapian::ValueRangeProcessor *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::ValueRangeProcessor *)new SwigDirector_ValueRangeProcessor(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueRangeProcessor(void *self) {
    Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_ValueRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueRangeProcessor * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< std::string * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string &","operator ()", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::string * >(argp3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::ValueRangeProcessor::operator ()");
        } else {
          result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueRangeProcessor_release(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::ValueRangeProcessor *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueRangeProcessor const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueRangeProcessor * >(argp1);
  {
    try {
      result = (Xapian::ValueRangeProcessor *)((Xapian::ValueRangeProcessor const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ValueRangeProcessor, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_ValueRangeProcessor(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__ValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueRangeProcessor *","disown_ValueRangeProcessor", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueRangeProcessor * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassStringValueRangeProcessor;

SWIGINTERN VALUE
_wrap_new_StringValueRangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::StringValueRangeProcessor";
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","StringValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_StringValueRangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::StringValueRangeProcessor";
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","StringValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","StringValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","StringValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","StringValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_StringValueRangeProcessor_allocate(VALUE self)
#else
_wrap_StringValueRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__StringValueRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_StringValueRangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::StringValueRangeProcessor";
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","StringValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","StringValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","StringValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_StringValueRangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_StringValueRangeProcessor__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_StringValueRangeProcessor__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_StringValueRangeProcessor__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "StringValueRangeProcessor.new", 
    "    StringValueRangeProcessor.new(Xapian::valueno slot_)\n"
    "    StringValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, bool prefix_)\n"
    "    StringValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_StringValueRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__StringValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::StringValueRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::StringValueRangeProcessor * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< std::string * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string &","operator ()", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::string * >(argp3);
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_StringValueRangeProcessor(void *self) {
    Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *)self;
    delete arg1;
}

static swig_class SwigClassDateValueRangeProcessor;

SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  int arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_bool(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 2, argv[1] ));
  } 
  arg2 = static_cast< bool >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","DateValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_bool(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 2, argv[1] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  int arg5 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< bool >(val3);
  ecode4 = SWIG_AsVal_bool(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 4, argv[3] ));
  } 
  arg4 = static_cast< bool >(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","DateValueRangeProcessor", 5, argv[4] ));
  } 
  arg5 = static_cast< int >(val5);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4,arg5);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< bool >(val3);
  ecode4 = SWIG_AsVal_bool(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 4, argv[3] ));
  } 
  arg4 = static_cast< bool >(val4);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","DateValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_DateValueRangeProcessor_allocate(VALUE self)
#else
_wrap_DateValueRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__DateValueRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_DateValueRangeProcessor__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::DateValueRangeProcessor";
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DateValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","DateValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","DateValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_DateValueRangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs;
  if (argc > 5) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_DateValueRangeProcessor__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_DateValueRangeProcessor__SWIG_6(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_bool(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_DateValueRangeProcessor__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_DateValueRangeProcessor__SWIG_5(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_bool(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_DateValueRangeProcessor__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_bool(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_DateValueRangeProcessor__SWIG_4(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_bool(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_DateValueRangeProcessor__SWIG_3(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "DateValueRangeProcessor.new", 
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, bool prefer_mdy_, int epoch_year_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, bool prefer_mdy_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, bool prefix_, bool prefer_mdy_, int epoch_year_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, bool prefix_, bool prefer_mdy_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, bool prefix_)\n"
    "    DateValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DateValueRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DateValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DateValueRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DateValueRangeProcessor * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< std::string * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string &","operator ()", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::string * >(argp3);
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_DateValueRangeProcessor(void *self) {
    Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *)self;
    delete arg1;
}

static swig_class SwigClassNumberValueRangeProcessor;

SWIGINTERN VALUE
_wrap_new_NumberValueRangeProcessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::NumberValueRangeProcessor";
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_NumberValueRangeProcessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::NumberValueRangeProcessor";
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","NumberValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","NumberValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","NumberValueRangeProcessor", 3, argv[2] ));
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_NumberValueRangeProcessor_allocate(VALUE self)
#else
_wrap_NumberValueRangeProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__NumberValueRangeProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_NumberValueRangeProcessor__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::NumberValueRangeProcessor";
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","NumberValueRangeProcessor", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","NumberValueRangeProcessor", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","NumberValueRangeProcessor", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return self;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_NumberValueRangeProcessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_NumberValueRangeProcessor__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_NumberValueRangeProcessor__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_NumberValueRangeProcessor__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "NumberValueRangeProcessor.new", 
    "    NumberValueRangeProcessor.new(Xapian::valueno slot_)\n"
    "    NumberValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_, bool prefix_)\n"
    "    NumberValueRangeProcessor.new(Xapian::valueno slot_, std::string const &str_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_NumberValueRangeProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__NumberValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::NumberValueRangeProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::NumberValueRangeProcessor * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< std::string * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__string,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string &","operator ()", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string &","operator ()", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< std::string * >(argp3);
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_NumberValueRangeProcessor(void *self) {
    Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *)self;
    delete arg1;
}

static swig_class SwigClassFieldProcessor;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_FieldProcessor_allocate(VALUE self)
#else
_wrap_FieldProcessor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__FieldProcessor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_FieldProcessor(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::FieldProcessor";
  Xapian::FieldProcessor *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::FieldProcessor *)new SwigDirector_FieldProcessor(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_FieldProcessor(void *self) {
    Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_FieldProcessor___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FieldProcessor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","operator ()", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::FieldProcessor::operator ()");
        } else {
          result = (arg1)->operator ()((std::string const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FieldProcessor_release(int argc, VALUE *argv, VALUE self) {
  Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::FieldProcessor *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FieldProcessor const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FieldProcessor * >(argp1);
  {
    try {
      result = (Xapian::FieldProcessor *)((Xapian::FieldProcessor const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_FieldProcessor(int argc, VALUE *argv, VALUE self) {
  Xapian::FieldProcessor *arg1 = (Xapian::FieldProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","disown_FieldProcessor", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::FieldProcessor * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassQueryParser;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_QueryParser_allocate(VALUE self)
#else
_wrap_QueryParser_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__QueryParser);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_QueryParser(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::QueryParser";
  Xapian::QueryParser *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::QueryParser *)new Xapian::QueryParser();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_QueryParser(void *self) {
    Xapian::QueryParser *arg1 = (Xapian::QueryParser *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_QueryParser_stemmere___(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_stemmer", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Stem,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Stem const &","set_stemmer", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Stem const &","set_stemmer", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Stem * >(argp2);
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_stemming_strategye___(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::QueryParser::stem_strategy arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_stemming_strategy", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::QueryParser::stem_strategy","set_stemming_strategy", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::QueryParser::stem_strategy >(val2);
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_stoppere_____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_stopper", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__Stopper, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Stopper const *","set_stopper", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::Stopper * >(argp2);
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_stoppere_____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_stopper", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_stoppere___(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_QueryParser_stoppere_____SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__Stopper, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_QueryParser_stoppere_____SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "QueryParser.stopper=", 
    "    void QueryParser.stopper=(Xapian::Stopper const *stop)\n"
    "    void QueryParser.stopper=()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_default_ope___(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_default_op", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Query::op","set_default_op", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::Query::op >(val2);
  {
    try {
      (arg1)->set_default_op(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_default_op(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Query::op result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","get_default_op", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    try {
      result = (Xapian::Query::op)((Xapian::QueryParser const *)arg1)->get_default_op();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_databasee___(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_database", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","set_database", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","set_database", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->set_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_set_max_expansion__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  int arg3 ;
  unsigned int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_max_expansion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","set_max_expansion", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_max_expansion", 3, argv[1] ));
  } 
  arg3 = static_cast< int >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","set_max_expansion", 4, argv[2] ));
  } 
  arg4 = static_cast< unsigned int >(val4);
  {
    try {
      (arg1)->set_max_expansion(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_set_max_expansion__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_max_expansion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","set_max_expansion", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_max_expansion", 3, argv[1] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      (arg1)->set_max_expansion(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_set_max_expansion__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_max_expansion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","set_max_expansion", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  {
    try {
      (arg1)->set_max_expansion(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_set_max_expansion(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_QueryParser_set_max_expansion__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_QueryParser_set_max_expansion__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_QueryParser_set_max_expansion__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "QueryParser.set_max_expansion", 
    "    void QueryParser.set_max_expansion(Xapian::termcount max_expansion, int max_type, unsigned int flags)\n"
    "    void QueryParser.set_max_expansion(Xapian::termcount max_expansion, int max_type)\n"
    "    void QueryParser.set_max_expansion(Xapian::termcount max_expansion)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_set_max_wildcard_expansion(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","set_max_wildcard_expansion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","set_max_wildcard_expansion", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  {
    try {
      (arg1)->set_max_wildcard_expansion(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_parse_query__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int res4 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","parse_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","parse_query", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","parse_query", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","parse_query", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    std::string *ptr = (std::string *)0;
    res4 = SWIG_AsPtr_std_string(argv[2], &ptr);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const &","parse_query", 4, argv[2] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","parse_query", 4, argv[2])); 
    }
    arg4 = ptr;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res4)) delete arg4;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_parse_query__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","parse_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","parse_query", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","parse_query", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","parse_query", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_parse_query__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::Query result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","parse_query", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","parse_query", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","parse_query", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Query(static_cast< const Xapian::Query& >(result))), SWIGTYPE_p_Xapian__Query, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_parse_query(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_QueryParser_parse_query__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_QueryParser_parse_query__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_QueryParser_parse_query__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "QueryParser.parse_query", 
    "    Xapian::Query QueryParser.parse_query(std::string const &query_string, unsigned int flags, std::string const &default_prefix)\n"
    "    Xapian::Query QueryParser.parse_query(std::string const &query_string, unsigned int flags)\n"
    "    Xapian::Query QueryParser.parse_query(std::string const &query_string)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_prefix__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_prefix", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_prefix", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_prefix__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","add_prefix", 3, argv[1] )); 
  }
  arg3 = reinterpret_cast< Xapian::FieldProcessor * >(argp3);
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_add_prefix(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__FieldProcessor, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_QueryParser_add_prefix__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_QueryParser_add_prefix__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "QueryParser.add_prefix", 
    "    void QueryParser.add_prefix(std::string const &field, std::string const &prefix)\n"
    "    void QueryParser.add_prefix(std::string const &field, Xapian::FieldProcessor *proc)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string *arg4 = (std::string *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_std__string, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const *","add_boolean_prefix", 4, argv[2] )); 
  }
  arg4 = reinterpret_cast< std::string * >(argp4);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3,(std::string const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  bool val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  ecode4 = SWIG_AsVal_bool(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","add_boolean_prefix", 4, argv[2] ));
  } 
  arg4 = static_cast< bool >(val4);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  std::string *arg4 = (std::string *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","add_boolean_prefix", 3, argv[1] )); 
  }
  arg3 = reinterpret_cast< Xapian::FieldProcessor * >(argp3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_std__string, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const *","add_boolean_prefix", 4, argv[2] )); 
  }
  arg4 = reinterpret_cast< std::string * >(argp4);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,arg3,(std::string const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","add_boolean_prefix", 3, argv[1] )); 
  }
  arg3 = reinterpret_cast< Xapian::FieldProcessor * >(argp3);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_boolean_prefix__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::FieldProcessor *arg3 = (Xapian::FieldProcessor *) 0 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_boolean_prefix", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_boolean_prefix", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_boolean_prefix", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_Xapian__FieldProcessor, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::FieldProcessor *","add_boolean_prefix", 3, argv[1] )); 
  }
  arg3 = reinterpret_cast< Xapian::FieldProcessor * >(argp3);
  ecode4 = SWIG_AsVal_bool(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","add_boolean_prefix", 4, argv[2] ));
  } 
  arg4 = static_cast< bool >(val4);
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_add_boolean_prefix(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__FieldProcessor, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_QueryParser_add_boolean_prefix__SWIG_4(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_QueryParser_add_boolean_prefix__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__FieldProcessor, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_3(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__FieldProcessor, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_bool(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_5(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_bool(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_QueryParser_add_boolean_prefix__SWIG_2(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "QueryParser.add_boolean_prefix", 
    "    void QueryParser.add_boolean_prefix(std::string const &field, std::string const &prefix, std::string const *grouping)\n"
    "    void QueryParser.add_boolean_prefix(std::string const &field, std::string const &prefix)\n"
    "    void QueryParser.add_boolean_prefix(std::string const &field, std::string const &prefix, bool exclusive)\n"
    "    void QueryParser.add_boolean_prefix(std::string const &field, Xapian::FieldProcessor *proc, std::string const *grouping)\n"
    "    void QueryParser.add_boolean_prefix(std::string const &field, Xapian::FieldProcessor *proc)\n"
    "    void QueryParser.add_boolean_prefix(std::string const &field, Xapian::FieldProcessor *proc, bool exclusive)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser__dangerous_stoplist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","stoplist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->stoplist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser__dangerous_stoplist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","stoplist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  result = ((Xapian::QueryParser const *)arg1)->stoplist_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser__dangerous_unstem_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","unstem_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","unstem_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","unstem_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser__dangerous_unstem_end(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","unstem_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","unstem_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","unstem_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_rangeprocessor__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::RangeProcessor *arg2 = (Xapian::RangeProcessor *) 0 ;
  std::string *arg3 = (std::string *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_rangeprocessor", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::RangeProcessor *","add_rangeprocessor", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::RangeProcessor * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_std__string, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const *","add_rangeprocessor", 3, argv[1] )); 
  }
  arg3 = reinterpret_cast< std::string * >(argp3);
  {
    try {
      (arg1)->add_rangeprocessor(arg2,(std::string const *)arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_rangeprocessor__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::RangeProcessor *arg2 = (Xapian::RangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_rangeprocessor", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__RangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::RangeProcessor *","add_rangeprocessor", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::RangeProcessor * >(argp2);
  {
    try {
      (arg1)->add_rangeprocessor(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_QueryParser_add_rangeprocessor(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__RangeProcessor, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_QueryParser_add_rangeprocessor__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__QueryParser, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__RangeProcessor, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_QueryParser_add_rangeprocessor__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "QueryParser.add_rangeprocessor", 
    "    void QueryParser.add_rangeprocessor(Xapian::RangeProcessor *range_proc, std::string const *grouping)\n"
    "    void QueryParser.add_rangeprocessor(Xapian::RangeProcessor *range_proc)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_add_valuerangeprocessor(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::ValueRangeProcessor *arg2 = (Xapian::ValueRangeProcessor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser *","add_valuerangeprocessor", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Xapian__ValueRangeProcessor, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::ValueRangeProcessor *","add_valuerangeprocessor", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< Xapian::ValueRangeProcessor * >(argp2);
  {
    try {
      (arg1)->add_valuerangeprocessor(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_get_corrected_query_string(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","get_corrected_query_string", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_corrected_query_string();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_QueryParser_description(int argc, VALUE *argv, VALUE self) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__QueryParser, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::QueryParser const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::QueryParser * >(argp1);
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_sortable_serialise(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Xapian::sortable_serialise", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = Xapian::sortable_serialise(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_sortable_unserialise(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::sortable_unserialise", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::sortable_unserialise", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (double)Xapian::sortable_unserialise((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


static swig_class SwigClassValueSetMatchDecider;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueSetMatchDecider_allocate(VALUE self)
#else
_wrap_ValueSetMatchDecider_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueSetMatchDecider);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueSetMatchDecider(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValueSetMatchDecider";
  Xapian::ValueSetMatchDecider *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","ValueSetMatchDecider", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_bool(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","ValueSetMatchDecider", 2, argv[1] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      result = (Xapian::ValueSetMatchDecider *)new Xapian::ValueSetMatchDecider(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueSetMatchDecider_add_value(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueSetMatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueSetMatchDecider *","add_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueSetMatchDecider * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_value", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_value", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_value((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueSetMatchDecider_remove_value(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueSetMatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueSetMatchDecider *","remove_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueSetMatchDecider * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_value", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_value", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->remove_value((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueSetMatchDecider___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueSetMatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueSetMatchDecider const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueSetMatchDecider * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      result = (bool)((Xapian::ValueSetMatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueSetMatchDecider(void *self) {
    Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *)self;
    delete arg1;
}

static swig_class SwigClassWeight;

SWIGINTERN void
free_Xapian_Weight(void *self) {
    Xapian::Weight *arg1 = (Xapian::Weight *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = ((Xapian::Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassBoolWeight;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_BoolWeight_allocate(VALUE self)
#else
_wrap_BoolWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__BoolWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_BoolWeight(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::BoolWeight";
  Xapian::BoolWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BoolWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BoolWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BoolWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BoolWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BoolWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BoolWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BoolWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BoolWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BoolWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BoolWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::BoolWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_BoolWeight(void *self) {
    Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *)self;
    delete arg1;
}

static swig_class SwigClassTfIdfWeight;

SWIGINTERN VALUE
_wrap_new_TfIdfWeight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::TfIdfWeight";
  Xapian::TfIdfWeight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","TfIdfWeight", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","TfIdfWeight", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::TfIdfWeight *)new Xapian::TfIdfWeight((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_TfIdfWeight_allocate(VALUE self)
#else
_wrap_TfIdfWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__TfIdfWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_TfIdfWeight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::TfIdfWeight";
  Xapian::TfIdfWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::TfIdfWeight *)new Xapian::TfIdfWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_TfIdfWeight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_TfIdfWeight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_TfIdfWeight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "TfIdfWeight.new", 
    "    TfIdfWeight.new(std::string const &normalizations)\n"
    "    TfIdfWeight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TfIdfWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TfIdfWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TfIdfWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TfIdfWeight * >(argp1);
  {
    try {
      result = ((Xapian::TfIdfWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TfIdfWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TfIdfWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TfIdfWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TfIdfWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::TfIdfWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TfIdfWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TfIdfWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TfIdfWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TfIdfWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::TfIdfWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TfIdfWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TfIdfWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TfIdfWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TfIdfWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::TfIdfWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TfIdfWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TfIdfWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TfIdfWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TfIdfWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::TfIdfWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_TfIdfWeight(void *self) {
    Xapian::TfIdfWeight *arg1 = (Xapian::TfIdfWeight *)self;
    delete arg1;
}

static swig_class SwigClassBM25Weight;

SWIGINTERN VALUE
_wrap_new_BM25Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  double val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::BM25Weight";
  Xapian::BM25Weight *result = 0 ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","BM25Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","BM25Weight", 2, argv[1] ));
  } 
  arg2 = static_cast< double >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","BM25Weight", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","BM25Weight", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","BM25Weight", 5, argv[4] ));
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight(arg1,arg2,arg3,arg4,arg5);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_BM25Weight_allocate(VALUE self)
#else
_wrap_BM25Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__BM25Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_BM25Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::BM25Weight";
  Xapian::BM25Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_BM25Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs;
  if (argc > 5) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_BM25Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_BM25Weight__SWIG_0(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "BM25Weight.new", 
    "    BM25Weight.new(double k1, double k2, double k3, double b, double min_normlen)\n"
    "    BM25Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::BM25Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_BM25Weight(void *self) {
    Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *)self;
    delete arg1;
}

static swig_class SwigClassBM25PlusWeight;

SWIGINTERN VALUE
_wrap_new_BM25PlusWeight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  double arg6 ;
  double val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::BM25PlusWeight";
  Xapian::BM25PlusWeight *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 2, argv[1] ));
  } 
  arg2 = static_cast< double >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 5, argv[4] ));
  } 
  arg5 = static_cast< double >(val5);
  ecode6 = SWIG_AsVal_double(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","BM25PlusWeight", 6, argv[5] ));
  } 
  arg6 = static_cast< double >(val6);
  {
    try {
      result = (Xapian::BM25PlusWeight *)new Xapian::BM25PlusWeight(arg1,arg2,arg3,arg4,arg5,arg6);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_BM25PlusWeight_allocate(VALUE self)
#else
_wrap_BM25PlusWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__BM25PlusWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_BM25PlusWeight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::BM25PlusWeight";
  Xapian::BM25PlusWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::BM25PlusWeight *)new Xapian::BM25PlusWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_BM25PlusWeight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[6];
  int ii;
  
  argc = nargs;
  if (argc > 6) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_BM25PlusWeight__SWIG_1(nargs, args, self);
  }
  if (argc == 6) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                int res = SWIG_AsVal_double(argv[5], NULL);
                _v = SWIG_CheckState(res);
              }
              if (_v) {
                return _wrap_new_BM25PlusWeight__SWIG_0(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 6, "BM25PlusWeight.new", 
    "    BM25PlusWeight.new(double k1, double k2, double k3, double b, double min_normlen, double delta)\n"
    "    BM25PlusWeight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25PlusWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25PlusWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25PlusWeight * >(argp1);
  {
    try {
      result = ((Xapian::BM25PlusWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25PlusWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25PlusWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25PlusWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::BM25PlusWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25PlusWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25PlusWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25PlusWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::BM25PlusWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25PlusWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25PlusWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25PlusWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::BM25PlusWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BM25PlusWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BM25PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BM25PlusWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BM25PlusWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::BM25PlusWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_BM25PlusWeight(void *self) {
    Xapian::BM25PlusWeight *arg1 = (Xapian::BM25PlusWeight *)self;
    delete arg1;
}

static swig_class SwigClassTradWeight;

SWIGINTERN VALUE
_wrap_new_TradWeight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::TradWeight";
  Xapian::TradWeight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","TradWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_TradWeight_allocate(VALUE self)
#else
_wrap_TradWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__TradWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_TradWeight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::TradWeight";
  Xapian::TradWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_TradWeight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_TradWeight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_TradWeight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "TradWeight.new", 
    "    TradWeight.new(double k)\n"
    "    TradWeight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TradWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TradWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TradWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TradWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TradWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TradWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TradWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TradWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TradWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::TradWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::TradWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_TradWeight(void *self) {
    Xapian::TradWeight *arg1 = (Xapian::TradWeight *)self;
    delete arg1;
}

static swig_class SwigClassInL2Weight;

SWIGINTERN VALUE
_wrap_new_InL2Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::InL2Weight";
  Xapian::InL2Weight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","InL2Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::InL2Weight *)new Xapian::InL2Weight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_InL2Weight_allocate(VALUE self)
#else
_wrap_InL2Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__InL2Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_InL2Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::InL2Weight";
  Xapian::InL2Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::InL2Weight *)new Xapian::InL2Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_InL2Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_InL2Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_InL2Weight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "InL2Weight.new", 
    "    InL2Weight.new(double c)\n"
    "    InL2Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_InL2Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__InL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::InL2Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::InL2Weight * >(argp1);
  {
    try {
      result = ((Xapian::InL2Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_InL2Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__InL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::InL2Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::InL2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::InL2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_InL2Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__InL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::InL2Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::InL2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::InL2Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_InL2Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__InL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::InL2Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::InL2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::InL2Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_InL2Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__InL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::InL2Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::InL2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::InL2Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_InL2Weight(void *self) {
    Xapian::InL2Weight *arg1 = (Xapian::InL2Weight *)self;
    delete arg1;
}

static swig_class SwigClassIfB2Weight;

SWIGINTERN VALUE
_wrap_new_IfB2Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::IfB2Weight";
  Xapian::IfB2Weight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","IfB2Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::IfB2Weight *)new Xapian::IfB2Weight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_IfB2Weight_allocate(VALUE self)
#else
_wrap_IfB2Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__IfB2Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_IfB2Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::IfB2Weight";
  Xapian::IfB2Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::IfB2Weight *)new Xapian::IfB2Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_IfB2Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_IfB2Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_IfB2Weight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "IfB2Weight.new", 
    "    IfB2Weight.new(double c)\n"
    "    IfB2Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IfB2Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IfB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IfB2Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IfB2Weight * >(argp1);
  {
    try {
      result = ((Xapian::IfB2Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IfB2Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IfB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IfB2Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IfB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::IfB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IfB2Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IfB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IfB2Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IfB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::IfB2Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IfB2Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IfB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IfB2Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IfB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::IfB2Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IfB2Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IfB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IfB2Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IfB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::IfB2Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_IfB2Weight(void *self) {
    Xapian::IfB2Weight *arg1 = (Xapian::IfB2Weight *)self;
    delete arg1;
}

static swig_class SwigClassIneB2Weight;

SWIGINTERN VALUE
_wrap_new_IneB2Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::IneB2Weight";
  Xapian::IneB2Weight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","IneB2Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::IneB2Weight *)new Xapian::IneB2Weight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_IneB2Weight_allocate(VALUE self)
#else
_wrap_IneB2Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__IneB2Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_IneB2Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::IneB2Weight";
  Xapian::IneB2Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::IneB2Weight *)new Xapian::IneB2Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_IneB2Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_IneB2Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_IneB2Weight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "IneB2Weight.new", 
    "    IneB2Weight.new(double c)\n"
    "    IneB2Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IneB2Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IneB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IneB2Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IneB2Weight * >(argp1);
  {
    try {
      result = ((Xapian::IneB2Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IneB2Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IneB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IneB2Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IneB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::IneB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IneB2Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IneB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IneB2Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IneB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::IneB2Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IneB2Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IneB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IneB2Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IneB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::IneB2Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_IneB2Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__IneB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::IneB2Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::IneB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::IneB2Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_IneB2Weight(void *self) {
    Xapian::IneB2Weight *arg1 = (Xapian::IneB2Weight *)self;
    delete arg1;
}

static swig_class SwigClassBB2Weight;

SWIGINTERN VALUE
_wrap_new_BB2Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::BB2Weight";
  Xapian::BB2Weight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","BB2Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::BB2Weight *)new Xapian::BB2Weight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_BB2Weight_allocate(VALUE self)
#else
_wrap_BB2Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__BB2Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_BB2Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::BB2Weight";
  Xapian::BB2Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::BB2Weight *)new Xapian::BB2Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_BB2Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_BB2Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_BB2Weight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "BB2Weight.new", 
    "    BB2Weight.new(double c)\n"
    "    BB2Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BB2Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BB2Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BB2Weight * >(argp1);
  {
    try {
      result = ((Xapian::BB2Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BB2Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BB2Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::BB2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BB2Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BB2Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::BB2Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BB2Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BB2Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BB2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::BB2Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_BB2Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__BB2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::BB2Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::BB2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::BB2Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_BB2Weight(void *self) {
    Xapian::BB2Weight *arg1 = (Xapian::BB2Weight *)self;
    delete arg1;
}

static swig_class SwigClassDLHWeight;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_DLHWeight_allocate(VALUE self)
#else
_wrap_DLHWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__DLHWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_DLHWeight(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::DLHWeight";
  Xapian::DLHWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::DLHWeight *)new Xapian::DLHWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DLHWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DLHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DLHWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DLHWeight * >(argp1);
  {
    try {
      result = ((Xapian::DLHWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DLHWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DLHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DLHWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DLHWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::DLHWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DLHWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DLHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DLHWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DLHWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::DLHWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DLHWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DLHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DLHWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DLHWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::DLHWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DLHWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DLHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DLHWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DLHWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::DLHWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_DLHWeight(void *self) {
    Xapian::DLHWeight *arg1 = (Xapian::DLHWeight *)self;
    delete arg1;
}

static swig_class SwigClassPL2Weight;

SWIGINTERN VALUE
_wrap_new_PL2Weight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::PL2Weight";
  Xapian::PL2Weight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","PL2Weight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::PL2Weight *)new Xapian::PL2Weight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_PL2Weight_allocate(VALUE self)
#else
_wrap_PL2Weight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__PL2Weight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_PL2Weight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::PL2Weight";
  Xapian::PL2Weight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::PL2Weight *)new Xapian::PL2Weight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_PL2Weight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_PL2Weight__SWIG_1(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_PL2Weight__SWIG_0(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "PL2Weight.new", 
    "    PL2Weight.new(double c)\n"
    "    PL2Weight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2Weight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2Weight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2Weight * >(argp1);
  {
    try {
      result = ((Xapian::PL2Weight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2Weight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2Weight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::PL2Weight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2Weight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2Weight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::PL2Weight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2Weight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2Weight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::PL2Weight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2Weight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2Weight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2Weight * >(argp1);
  {
    try {
      result = (double)((Xapian::PL2Weight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_PL2Weight(void *self) {
    Xapian::PL2Weight *arg1 = (Xapian::PL2Weight *)self;
    delete arg1;
}

static swig_class SwigClassPL2PlusWeight;

SWIGINTERN VALUE
_wrap_new_PL2PlusWeight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double arg2 ;
  double val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::PL2PlusWeight";
  Xapian::PL2PlusWeight *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","PL2PlusWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","PL2PlusWeight", 2, argv[1] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      result = (Xapian::PL2PlusWeight *)new Xapian::PL2PlusWeight(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_PL2PlusWeight_allocate(VALUE self)
#else
_wrap_PL2PlusWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__PL2PlusWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_PL2PlusWeight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::PL2PlusWeight";
  Xapian::PL2PlusWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::PL2PlusWeight *)new Xapian::PL2PlusWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_PL2PlusWeight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_PL2PlusWeight__SWIG_1(nargs, args, self);
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_PL2PlusWeight__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "PL2PlusWeight.new", 
    "    PL2PlusWeight.new(double c, double delta)\n"
    "    PL2PlusWeight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2PlusWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2PlusWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2PlusWeight * >(argp1);
  {
    try {
      result = ((Xapian::PL2PlusWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2PlusWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2PlusWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2PlusWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::PL2PlusWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2PlusWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2PlusWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2PlusWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::PL2PlusWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2PlusWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2PlusWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2PlusWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::PL2PlusWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PL2PlusWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PL2PlusWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PL2PlusWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PL2PlusWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::PL2PlusWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_PL2PlusWeight(void *self) {
    Xapian::PL2PlusWeight *arg1 = (Xapian::PL2PlusWeight *)self;
    delete arg1;
}

static swig_class SwigClassDPHWeight;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_DPHWeight_allocate(VALUE self)
#else
_wrap_DPHWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__DPHWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_DPHWeight(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::DPHWeight";
  Xapian::DPHWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::DPHWeight *)new Xapian::DPHWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DPHWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DPHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DPHWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DPHWeight * >(argp1);
  {
    try {
      result = ((Xapian::DPHWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DPHWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DPHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DPHWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DPHWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::DPHWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DPHWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DPHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DPHWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DPHWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::DPHWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DPHWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DPHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DPHWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DPHWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::DPHWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DPHWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DPHWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DPHWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DPHWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::DPHWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_DPHWeight(void *self) {
    Xapian::DPHWeight *arg1 = (Xapian::DPHWeight *)self;
    delete arg1;
}

static swig_class SwigClassLMWeight;

SWIGINTERN VALUE
_wrap_new_LMWeight__SWIG_0(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  Xapian::Weight::type_smoothing arg2 ;
  double arg3 ;
  double arg4 ;
  double val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LMWeight";
  Xapian::LMWeight *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","LMWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Weight::type_smoothing","LMWeight", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::Weight::type_smoothing >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","LMWeight", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LMWeight", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1,arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LMWeight__SWIG_1(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  Xapian::Weight::type_smoothing arg2 ;
  double arg3 ;
  double val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LMWeight";
  Xapian::LMWeight *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","LMWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Weight::type_smoothing","LMWeight", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::Weight::type_smoothing >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","LMWeight", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LMWeight__SWIG_2(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  Xapian::Weight::type_smoothing arg2 ;
  double val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LMWeight";
  Xapian::LMWeight *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","LMWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Weight::type_smoothing","LMWeight", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::Weight::type_smoothing >(val2);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LMWeight__SWIG_3(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LMWeight";
  Xapian::LMWeight *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","LMWeight", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LMWeight_allocate(VALUE self)
#else
_wrap_LMWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LMWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LMWeight__SWIG_4(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::LMWeight";
  Xapian::LMWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::LMWeight *)new Xapian::LMWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_LMWeight(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs;
  if (argc > 4) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_LMWeight__SWIG_4(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_LMWeight__SWIG_3(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_LMWeight__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_LMWeight__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_LMWeight__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "LMWeight.new", 
    "    LMWeight.new(double param_log_, Xapian::Weight::type_smoothing select_smoothing_, double param_smoothing1_, double param_smoothing2_)\n"
    "    LMWeight.new(double param_log_, Xapian::Weight::type_smoothing select_smoothing_, double param_smoothing1_)\n"
    "    LMWeight.new(double param_log_, Xapian::Weight::type_smoothing select_smoothing_)\n"
    "    LMWeight.new(double param_log_)\n"
    "    LMWeight.new()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LMWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LMWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LMWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LMWeight * >(argp1);
  {
    try {
      result = ((Xapian::LMWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LMWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LMWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LMWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LMWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::LMWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LMWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LMWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LMWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LMWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::LMWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LMWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LMWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LMWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LMWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::LMWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LMWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::LMWeight *arg1 = (Xapian::LMWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LMWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LMWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LMWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::LMWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_LMWeight(void *self) {
    Xapian::LMWeight *arg1 = (Xapian::LMWeight *)self;
    delete arg1;
}

static swig_class SwigClassCoordWeight;

SWIGINTERN VALUE
_wrap_CoordWeight_init(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","init", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->init(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_CoordWeight_allocate(VALUE self)
#else
_wrap_CoordWeight_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__CoordWeight);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_CoordWeight(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::CoordWeight";
  Xapian::CoordWeight *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::CoordWeight *)new Xapian::CoordWeight();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_CoordWeight_name(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  {
    try {
      result = ((Xapian::CoordWeight const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_CoordWeight_sumpart(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  Xapian::termcount arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight const *","get_sumpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumpart", 4, argv[2] ));
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      result = (double)((Xapian::CoordWeight const *)arg1)->get_sumpart(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_CoordWeight_maxpart(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight const *","get_maxpart", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::CoordWeight const *)arg1)->get_maxpart();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_CoordWeight_sumextra(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight const *","get_sumextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","get_sumextra", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      result = (double)((Xapian::CoordWeight const *)arg1)->get_sumextra(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_CoordWeight_maxextra(int argc, VALUE *argv, VALUE self) {
  Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__CoordWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::CoordWeight const *","get_maxextra", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::CoordWeight * >(argp1);
  {
    try {
      result = (double)((Xapian::CoordWeight const *)arg1)->get_maxextra();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_CoordWeight(void *self) {
    Xapian::CoordWeight *arg1 = (Xapian::CoordWeight *)self;
    delete arg1;
}

static swig_class SwigClassCompactor;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Compactor_allocate(VALUE self)
#else
_wrap_Compactor_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Compactor);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Compactor(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::Compactor";
  Xapian::Compactor *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::Compactor *)new SwigDirector_Compactor(arg1); 
      } else {
        result = (Xapian::Compactor *)new Xapian::Compactor(); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_Compactor(void *self) {
    Xapian::Compactor *arg1 = (Xapian::Compactor *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Compactor_set_block_size(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_block_size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","set_block_size", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      (arg1)->set_block_size(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_set_renumber(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_renumber", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_renumber", 2, argv[0] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      (arg1)->set_renumber(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_set_multipass(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_multipass", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","set_multipass", 2, argv[0] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      (arg1)->set_multipass(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_set_compaction_level(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  Xapian::Compactor::compaction_level arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_compaction_level", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::Compactor::compaction_level","set_compaction_level", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::Compactor::compaction_level >(val2);
  {
    try {
      (arg1)->set_compaction_level(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_set_destdir(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_destdir", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_destdir", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_destdir", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->set_destdir((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_add_source(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","add_source", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_source", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_source", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_source((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_compact(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    try {
      (arg1)->compact();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_set_status(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","set_status", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_status", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_status", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","set_status", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_status", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::Compactor::set_status((std::string const &)*arg2,(std::string const &)*arg3);
        } else {
          (arg1)->set_status((std::string const &)*arg2,(std::string const &)*arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Compactor_resolve_duplicate_metadata(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  std::string *arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","resolve_duplicate_metadata", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","resolve_duplicate_metadata", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","resolve_duplicate_metadata", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "size_t","resolve_duplicate_metadata", 3, argv[1] ));
  } 
  arg3 = static_cast< size_t >(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_std__string, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::string const []","resolve_duplicate_metadata", 4, argv[2] )); 
  } 
  arg4 = reinterpret_cast< std::string * >(argp4);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->Xapian::Compactor::resolve_duplicate_metadata((std::string const &)*arg2,arg3,(std::string const (*))arg4);
        } else {
          result = (arg1)->resolve_duplicate_metadata((std::string const &)*arg2,arg3,(std::string const (*))arg4);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_Compactor(int argc, VALUE *argv, VALUE self) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__Compactor, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Compactor *","disown_Compactor", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::Compactor * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassPostingSource;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_PostingSource_allocate(VALUE self)
#else
_wrap_PostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__PostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_PostingSource(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::PostingSource";
  Xapian::PostingSource *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
    /* subclassed */
    result = (Xapian::PostingSource *)new SwigDirector_PostingSource(arg1); 
  } else {
    rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
    return Qnil;
  }
  
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_PostingSource(void *self) {
    Xapian::PostingSource *arg1 = (Xapian::PostingSource *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_PostingSource_get_termfreq_min(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_termfreq_min", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_min");
        } else {
          result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_min();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_get_termfreq_est(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_termfreq_est", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_est");
        } else {
          result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_est();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_get_termfreq_max(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_termfreq_max", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_max");
        } else {
          result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_max();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_set_maxweight(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","set_maxweight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","set_maxweight", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->set_maxweight(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_get_maxweight(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_maxweight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  result = (double)((Xapian::PostingSource const *)arg1)->get_maxweight();
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (double)((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::get_weight();
        } else {
          result = (double)((Xapian::PostingSource const *)arg1)->get_weight();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_docid");
        } else {
          result = (Xapian::docid)((Xapian::PostingSource const *)arg1)->get_docid();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_next(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","next", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::next");
        } else {
          (arg1)->next(arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","skip_to", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::PostingSource::skip_to(arg2,arg3);
        } else {
          (arg1)->skip_to(arg2,arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_check(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","check", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (bool)(arg1)->Xapian::PostingSource::check(arg2,arg3);
        } else {
          result = (bool)(arg1)->check(arg2,arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_at_end(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","at_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::at_end");
        } else {
          result = (bool)((Xapian::PostingSource const *)arg1)->at_end();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::name();
        } else {
          result = ((Xapian::PostingSource const *)arg1)->name();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::init");
        } else {
          (arg1)->init((Xapian::Database const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::get_description();
        } else {
          result = ((Xapian::PostingSource const *)arg1)->get_description();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_PostingSource_release(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::PostingSource *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  {
    try {
      result = (Xapian::PostingSource *)((Xapian::PostingSource const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_PostingSource(int argc, VALUE *argv, VALUE self) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__PostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::PostingSource *","disown_PostingSource", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::PostingSource * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassValuePostingSource;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValuePostingSource_allocate(VALUE self)
#else
_wrap_ValuePostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValuePostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValuePostingSource(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  Xapian::valueno arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValuePostingSource";
  Xapian::ValuePostingSource *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  arg1 = self;
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","ValuePostingSource", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::ValuePostingSource *)new SwigDirector_ValuePostingSource(arg1,arg2); 
      } else {
        result = (Xapian::ValuePostingSource *)new Xapian::ValuePostingSource(arg2); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_termfreq_min(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_termfreq_min", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->Xapian::ValuePostingSource::get_termfreq_min();
        } else {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_min();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_termfreq_est(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_termfreq_est", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->Xapian::ValuePostingSource::get_termfreq_est();
        } else {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_est();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_termfreq_max(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_termfreq_max", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->Xapian::ValuePostingSource::get_termfreq_max();
        } else {
          result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_max();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_next(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","next", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::ValuePostingSource::next(arg2);
        } else {
          (arg1)->next(arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","skip_to", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::ValuePostingSource::skip_to(arg2,arg3);
        } else {
          (arg1)->skip_to(arg2,arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_check(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","check", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (bool)(arg1)->Xapian::ValuePostingSource::check(arg2,arg3);
        } else {
          result = (bool)(arg1)->check(arg2,arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_at_end(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","at_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (bool)((Xapian::ValuePostingSource const *)arg1)->Xapian::ValuePostingSource::at_end();
        } else {
          result = (bool)((Xapian::ValuePostingSource const *)arg1)->at_end();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (Xapian::docid)((Xapian::ValuePostingSource const *)arg1)->Xapian::ValuePostingSource::get_docid();
        } else {
          result = (Xapian::docid)((Xapian::ValuePostingSource const *)arg1)->get_docid();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::ValuePostingSource::init((Xapian::Database const &)*arg2);
        } else {
          (arg1)->init((Xapian::Database const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_database(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_database", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    try {
      result = ((Xapian::ValuePostingSource const *)arg1)->get_database();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_slot(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::valueno result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_slot", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    try {
      result = (Xapian::valueno)((Xapian::ValuePostingSource const *)arg1)->get_slot();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_value(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_value", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    try {
      result = ((Xapian::ValuePostingSource const *)arg1)->get_value();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_done(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","done", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    try {
      (arg1)->done();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_get_started(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource const *","get_started", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    try {
      result = (bool)((Xapian::ValuePostingSource const *)arg1)->get_started();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_set_termfreq_min(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","set_termfreq_min", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","set_termfreq_min", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      (arg1)->set_termfreq_min(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_set_termfreq_est(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","set_termfreq_est", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","set_termfreq_est", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      (arg1)->set_termfreq_est(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValuePostingSource_set_termfreq_max(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::doccount arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","set_termfreq_max", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::doccount","set_termfreq_max", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      (arg1)->set_termfreq_max(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValuePostingSource(void *self) {
    Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_disown_ValuePostingSource(int argc, VALUE *argv, VALUE self) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__ValuePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValuePostingSource *","disown_ValuePostingSource", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::ValuePostingSource * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassValueWeightPostingSource;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueWeightPostingSource_allocate(VALUE self)
#else
_wrap_ValueWeightPostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueWeightPostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueWeightPostingSource(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  Xapian::valueno arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValueWeightPostingSource";
  Xapian::ValueWeightPostingSource *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  arg1 = self;
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","ValueWeightPostingSource", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::ValueWeightPostingSource *)new SwigDirector_ValueWeightPostingSource(arg1,arg2); 
      } else {
        result = (Xapian::ValueWeightPostingSource *)new Xapian::ValueWeightPostingSource(arg2); 
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueWeightPostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueWeightPostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueWeightPostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = (double)((Xapian::ValueWeightPostingSource const *)arg1)->Xapian::ValueWeightPostingSource::get_weight();
        } else {
          result = (double)((Xapian::ValueWeightPostingSource const *)arg1)->get_weight();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueWeightPostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueWeightPostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueWeightPostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::ValueWeightPostingSource const *)arg1)->Xapian::ValueWeightPostingSource::name();
        } else {
          result = ((Xapian::ValueWeightPostingSource const *)arg1)->name();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueWeightPostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueWeightPostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueWeightPostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::ValueWeightPostingSource::init((Xapian::Database const &)*arg2);
        } else {
          (arg1)->init((Xapian::Database const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueWeightPostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueWeightPostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueWeightPostingSource * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::ValueWeightPostingSource const *)arg1)->Xapian::ValueWeightPostingSource::get_description();
        } else {
          result = ((Xapian::ValueWeightPostingSource const *)arg1)->get_description();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueWeightPostingSource(void *self) {
    Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_disown_ValueWeightPostingSource(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__ValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueWeightPostingSource *","disown_ValueWeightPostingSource", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueWeightPostingSource * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassDecreasingValueWeightPostingSource;

SWIGINTERN VALUE
_wrap_new_DecreasingValueWeightPostingSource__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  Xapian::docid arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DecreasingValueWeightPostingSource";
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DecreasingValueWeightPostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","DecreasingValueWeightPostingSource", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::docid","DecreasingValueWeightPostingSource", 3, argv[2] ));
  } 
  arg3 = static_cast< Xapian::docid >(val3);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_DecreasingValueWeightPostingSource__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DecreasingValueWeightPostingSource";
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DecreasingValueWeightPostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","DecreasingValueWeightPostingSource", 2, argv[1] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_DecreasingValueWeightPostingSource_allocate(VALUE self)
#else
_wrap_DecreasingValueWeightPostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_DecreasingValueWeightPostingSource__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::DecreasingValueWeightPostingSource";
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","DecreasingValueWeightPostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_DecreasingValueWeightPostingSource(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_DecreasingValueWeightPostingSource__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_DecreasingValueWeightPostingSource__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_DecreasingValueWeightPostingSource__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "DecreasingValueWeightPostingSource.new", 
    "    DecreasingValueWeightPostingSource.new(Xapian::valueno slot_, Xapian::docid range_start_, Xapian::docid range_end_)\n"
    "    DecreasingValueWeightPostingSource.new(Xapian::valueno slot_, Xapian::docid range_start_)\n"
    "    DecreasingValueWeightPostingSource.new(Xapian::valueno slot_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  {
    try {
      result = (double)((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_next(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","next", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","skip_to", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_check(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","check", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_DecreasingValueWeightPostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::DecreasingValueWeightPostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::DecreasingValueWeightPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_DecreasingValueWeightPostingSource(void *self) {
    Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *)self;
    delete arg1;
}

static swig_class SwigClassValueMapPostingSource;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueMapPostingSource_allocate(VALUE self)
#else
_wrap_ValueMapPostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueMapPostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueMapPostingSource(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValueMapPostingSource";
  Xapian::ValueMapPostingSource *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","ValueMapPostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::ValueMapPostingSource *)new Xapian::ValueMapPostingSource(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_add_mapping(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  std::string *arg2 = 0 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource *","add_mapping", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_mapping", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_mapping", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","add_mapping", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->add_mapping((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_clear_mappings(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource *","clear_mappings", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  {
    try {
      (arg1)->clear_mappings();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_set_default_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource *","set_default_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","set_default_weight", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->set_default_weight(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  {
    try {
      result = (double)((Xapian::ValueMapPostingSource const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueMapPostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueMapPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueMapPostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueMapPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueMapPostingSource(void *self) {
    Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *)self;
    delete arg1;
}

static swig_class SwigClassFixedWeightPostingSource;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_FixedWeightPostingSource_allocate(VALUE self)
#else
_wrap_FixedWeightPostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__FixedWeightPostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_FixedWeightPostingSource(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::FixedWeightPostingSource";
  Xapian::FixedWeightPostingSource *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","FixedWeightPostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::FixedWeightPostingSource *)new Xapian::FixedWeightPostingSource(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_get_termfreq_min(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_termfreq_min", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_get_termfreq_est(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_termfreq_est", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_get_termfreq_max(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_termfreq_max", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (double)((Xapian::FixedWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_next(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","next", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","skip_to", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_check(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","check", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_at_end(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","at_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (bool)((Xapian::FixedWeightPostingSource const *)arg1)->at_end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_docid(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_docid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = (Xapian::docid)((Xapian::FixedWeightPostingSource const *)arg1)->get_docid();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_FixedWeightPostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__FixedWeightPostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::FixedWeightPostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::FixedWeightPostingSource * >(argp1);
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_FixedWeightPostingSource(void *self) {
    Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *)self;
    delete arg1;
}

static swig_class SwigClassMatchSpy;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_MatchSpy_allocate(VALUE self)
#else
_wrap_MatchSpy_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__MatchSpy);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_MatchSpy(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::MatchSpy";
  Xapian::MatchSpy *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
    /* subclassed */
    result = (Xapian::MatchSpy *)new SwigDirector_MatchSpy(arg1); 
  } else {
    rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
    return Qnil;
  }
  
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_MatchSpy(void *self) {
    Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_MatchSpy___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","operator ()", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::MatchSpy::operator ()");
        } else {
          (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MatchSpy_name(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::MatchSpy const *)arg1)->Xapian::MatchSpy::name();
        } else {
          result = ((Xapian::MatchSpy const *)arg1)->name();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MatchSpy_merge_results(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Swig::Director *director = 0;
  bool upcall = false;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy *","merge_results", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","merge_results", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","merge_results", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          (arg1)->Xapian::MatchSpy::merge_results((std::string const &)*arg2);
        } else {
          (arg1)->merge_results((std::string const &)*arg2);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MatchSpy_description(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          result = ((Xapian::MatchSpy const *)arg1)->Xapian::MatchSpy::get_description();
        } else {
          result = ((Xapian::MatchSpy const *)arg1)->get_description();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_MatchSpy_release(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  Xapian::MatchSpy *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy const *","release", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  {
    try {
      result = (Xapian::MatchSpy *)((Xapian::MatchSpy const *)arg1)->release();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  director = dynamic_cast<Swig::Director *>(result);
  if (director) {
    vresult = director->swig_get_self();
  } else {
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_MatchSpy(int argc, VALUE *argv, VALUE self) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__MatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::MatchSpy *","disown_MatchSpy", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::MatchSpy * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassValueCountMatchSpy;

SWIGINTERN VALUE
_wrap_new_ValueCountMatchSpy__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::ValueCountMatchSpy";
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_ValueCountMatchSpy_allocate(VALUE self)
#else
_wrap_ValueCountMatchSpy_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__ValueCountMatchSpy);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_ValueCountMatchSpy__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::ValueCountMatchSpy";
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","ValueCountMatchSpy", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_ValueCountMatchSpy(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_ValueCountMatchSpy__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_ValueCountMatchSpy__SWIG_1(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "ValueCountMatchSpy.new", 
    "    ValueCountMatchSpy.new()\n"
    "    ValueCountMatchSpy.new(Xapian::valueno slot_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy_get_total(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","get_total", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_total();
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy__dangerous_values_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","values_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy__dangerous_values_end(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","values_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy__dangerous_top_values_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","top_values_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","top_values_begin", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy__dangerous_top_values_end(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","top_values_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","top_values_end", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_end(arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","operator ()", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy_name(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy_merge_results(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy *","merge_results", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","merge_results", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","merge_results", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->merge_results((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_ValueCountMatchSpy_description(int argc, VALUE *argv, VALUE self) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__ValueCountMatchSpy, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::ValueCountMatchSpy const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::ValueCountMatchSpy * >(argp1);
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_ValueCountMatchSpy(void *self) {
    Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_miles_to_metres(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Xapian::miles_to_metres", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (double)Xapian::miles_to_metres(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_metres_to_miles(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","Xapian::metres_to_miles", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (double)Xapian::metres_to_miles(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassLatLongCoord;

SWIGINTERN VALUE
_wrap_LatLongCoord_latitude_set(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord *","latitude", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","latitude", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  if (arg1) (arg1)->latitude = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_latitude_get(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord *","latitude", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  result = (double) ((arg1)->latitude);
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_longitude_set(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord *","longitude", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","longitude", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  if (arg1) (arg1)->longitude = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_longitude_get(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord *","longitude", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  result = (double) ((arg1)->longitude);
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongCoord__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::LatLongCoord";
  Xapian::LatLongCoord *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::LatLongCoord *)new Xapian::LatLongCoord();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongCoord_allocate(VALUE self)
#else
_wrap_LatLongCoord_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongCoord);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongCoord__SWIG_1(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double arg2 ;
  double val1 ;
  int ecode1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongCoord";
  Xapian::LatLongCoord *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","LatLongCoord", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","LatLongCoord", 2, argv[1] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      result = (Xapian::LatLongCoord *)new Xapian::LatLongCoord(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_LatLongCoord(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_LatLongCoord__SWIG_0(nargs, args, self);
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_LatLongCoord__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "LatLongCoord.new", 
    "    LatLongCoord.new()\n"
    "    LatLongCoord.new(double latitude_, double longitude_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_unserialise(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord *","unserialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","unserialise", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","unserialise", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_serialise(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const *","serialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoord const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoord_description(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoord, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoord const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_LatLongCoord(void *self) {
    Xapian::LatLongCoord *arg1 = (Xapian::LatLongCoord *)self;
    delete arg1;
}

static swig_class SwigClassLatLongCoordsIterator;

SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongCoordsIterator_allocate(VALUE self)
#else
_wrap_LatLongCoordsIterator_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongCoordsIterator);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongCoordsIterator(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::LatLongCoordsIterator";
  Xapian::LatLongCoordsIterator *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::LatLongCoordsIterator *)new Xapian::LatLongCoordsIterator();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::LatLongCoordsIterator.==

  call-seq:
    ==(other) -> bool

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_LatLongCoordsIterator___eq__(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  Xapian::LatLongCoordsIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoordsIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator const *","operator ==", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoordsIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator const &","operator ==", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoordsIterator const &","operator ==", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp2);
  {
    try {
      result = (bool)((Xapian::LatLongCoordsIterator const *)arg1)->operator ==((Xapian::LatLongCoordsIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoordsIterator_equals(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  Xapian::LatLongCoordsIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoordsIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator const *","equals", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoordsIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator const &","equals", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoordsIterator const &","equals", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_LatLongCoordsIterator_equals((Xapian::LatLongCoordsIterator const *)arg1,(Xapian::LatLongCoordsIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoordsIterator_get_coord(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::LatLongCoord result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoordsIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator const *","get_coord", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp1);
  {
    try {
      result = Xapian_LatLongCoordsIterator_get_coord((Xapian::LatLongCoordsIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::LatLongCoord(static_cast< const Xapian::LatLongCoord& >(result))), SWIGTYPE_p_Xapian__LatLongCoord, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoordsIterator_next(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoordsIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoordsIterator *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoordsIterator * >(argp1);
  {
    try {
      Xapian_LatLongCoordsIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_LatLongCoordsIterator(void *self) {
    Xapian::LatLongCoordsIterator *arg1 = (Xapian::LatLongCoordsIterator *)self;
    delete arg1;
}

static swig_class SwigClassLatLongCoords;


/*
  Document-method: Xapian::LatLongCoords._begin

  call-seq:
    _begin -> LatLongCoordsIterator

Return an iterator to the beginning of the LatLongCoords.
*/
SWIGINTERN VALUE
_wrap_LatLongCoords__begin(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::LatLongCoordsIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::LatLongCoordsIterator(static_cast< const Xapian::LatLongCoordsIterator& >(result))), SWIGTYPE_p_Xapian__LatLongCoordsIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::LatLongCoords._end

  call-seq:
    _end -> LatLongCoordsIterator

Return an iterator to past the end of the LatLongCoords.
*/
SWIGINTERN VALUE
_wrap_LatLongCoords__end(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::LatLongCoordsIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::LatLongCoordsIterator(static_cast< const Xapian::LatLongCoordsIterator& >(result))), SWIGTYPE_p_Xapian__LatLongCoordsIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::LatLongCoords.size

  call-seq:
    size -> size_t

Size or Length of the LatLongCoords.
*/
SWIGINTERN VALUE
_wrap_LatLongCoords_size(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::LatLongCoords.empty

  call-seq:
    empty -> bool

Check if the LatLongCoords is empty or not.
*/
SWIGINTERN VALUE
_wrap_LatLongCoords_emptyq___(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","empty", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = (bool)((Xapian::LatLongCoords const *)arg1)->empty();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = (result ? Qtrue : Qfalse);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoords_append(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords *","append", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","append", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","append", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  {
    try {
      (arg1)->append((Xapian::LatLongCoord const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongCoords__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::LatLongCoords";
  Xapian::LatLongCoords *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::LatLongCoords *)new Xapian::LatLongCoords();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongCoords_allocate(VALUE self)
#else
_wrap_LatLongCoords_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongCoords);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongCoords__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoord *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongCoords";
  Xapian::LatLongCoords *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","LatLongCoords", 1, argv[0] )); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","LatLongCoords", 1, argv[0])); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoord * >(argp1);
  {
    try {
      result = (Xapian::LatLongCoords *)new Xapian::LatLongCoords((Xapian::LatLongCoord const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_LatLongCoords(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_LatLongCoords__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__LatLongCoord, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_LatLongCoords__SWIG_1(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "LatLongCoords.new", 
    "    LatLongCoords.new()\n"
    "    LatLongCoords.new(Xapian::LatLongCoord const &coord)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoords_unserialise(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords *","unserialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","unserialise", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","unserialise", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoords_serialise(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","serialise", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongCoords_description(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongCoords, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongCoords * >(argp1);
  {
    try {
      result = ((Xapian::LatLongCoords const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_LatLongCoords(void *self) {
    Xapian::LatLongCoords *arg1 = (Xapian::LatLongCoords *)self;
    delete arg1;
}

static swig_class SwigClassLatLongMetric;

SWIGINTERN void
free_Xapian_LatLongMetric(void *self) {
    Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_LatLongMetric_pointwise_distance(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongCoord *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const *","pointwise_distance", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","pointwise_distance", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","pointwise_distance", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","pointwise_distance", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","pointwise_distance", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongCoord * >(argp3);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::LatLongMetric::pointwise_distance");
        } else {
          result = (double)((Xapian::LatLongMetric const *)arg1)->pointwise_distance((Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongCoord const &)*arg3);
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongMetric___call____SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongCoords *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","operator ()", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","operator ()", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongCoords * >(argp3);
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongCoords const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongMetric___call____SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","operator ()", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","operator ()", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongMetric___call____SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  size_t arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","operator ()", 3, argv[1] ));
  }
  arg3 = reinterpret_cast< char * >(buf3);
  ecode4 = SWIG_AsVal_size_t(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "size_t","operator ()", 4, argv[2] ));
  } 
  arg4 = static_cast< size_t >(val4);
  {
    try {
      result = (double)((Xapian::LatLongMetric const *)arg1)->operator ()((Xapian::LatLongCoords const &)*arg2,(char const *)arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return Qnil;
}


SWIGINTERN VALUE _wrap_LatLongMetric___call__(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 5) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_LatLongMetric___call____SWIG_0(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_LatLongMetric___call____SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_size_t(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_LatLongMetric___call____SWIG_2(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "LatLongMetric.__call__", 
    "    double LatLongMetric.__call__(Xapian::LatLongCoords const &a, Xapian::LatLongCoords const &b)\n"
    "    double LatLongMetric.__call__(Xapian::LatLongCoords const &a, std::string const &b)\n"
    "    double LatLongMetric.__call__(Xapian::LatLongCoords const &a, char const *b_ptr, size_t b_len)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongMetric_name(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  director = dynamic_cast<Swig::Director *>(arg1);
  upcall = (director && (director->swig_get_self() == self));
  try {
    {
      try {
        if (upcall) {
          Swig::DirectorPureVirtualException::raise("Xapian::LatLongMetric::name");
        } else {
          result = ((Xapian::LatLongMetric const *)arg1)->name();
        }
      } catch (...) {
        string msg;
        int code = XapianExceptionHandler(msg);
        SWIG_exception(code, msg.c_str());
      }
    }
  } catch (Swig::DirectorException& e) {
    rb_exc_raise(e.getError());
    SWIG_fail;
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongMetric_allocate(VALUE self)
#else
_wrap_LatLongMetric_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongMetric);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongMetric(int argc, VALUE *argv, VALUE self) {
  VALUE arg1 = (VALUE) 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongMetric";
  Xapian::LatLongMetric *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  arg1 = self;
  {
    try {
      if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
        /* subclassed */
        result = (Xapian::LatLongMetric *)new SwigDirector_LatLongMetric(arg1); 
      } else {
        rb_raise(rb_eNameError,"accessing abstract class or protected constructor"); 
        return Qnil;
      }
      
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_disown_LatLongMetric(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongMetric *arg1 = (Xapian::LatLongMetric *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Xapian__LatLongMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongMetric *","disown_LatLongMetric", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongMetric * >(argp1);
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassGreatCircleMetric;

SWIGINTERN VALUE
_wrap_new_GreatCircleMetric__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::GreatCircleMetric";
  Xapian::GreatCircleMetric *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::GreatCircleMetric *)new Xapian::GreatCircleMetric();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_GreatCircleMetric_allocate(VALUE self)
#else
_wrap_GreatCircleMetric_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__GreatCircleMetric);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_GreatCircleMetric__SWIG_1(int argc, VALUE *argv, VALUE self) {
  double arg1 ;
  double val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::GreatCircleMetric";
  Xapian::GreatCircleMetric *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_double(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","GreatCircleMetric", 1, argv[0] ));
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::GreatCircleMetric *)new Xapian::GreatCircleMetric(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_GreatCircleMetric(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_GreatCircleMetric__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_GreatCircleMetric__SWIG_1(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "GreatCircleMetric.new", 
    "    GreatCircleMetric.new()\n"
    "    GreatCircleMetric.new(double radius_)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_GreatCircleMetric_pointwise_distance(int argc, VALUE *argv, VALUE self) {
  Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *) 0 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongCoord *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__GreatCircleMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::GreatCircleMetric const *","pointwise_distance", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::GreatCircleMetric * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","pointwise_distance", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","pointwise_distance", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","pointwise_distance", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","pointwise_distance", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongCoord * >(argp3);
  {
    try {
      result = (double)((Xapian::GreatCircleMetric const *)arg1)->pointwise_distance((Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongCoord const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_GreatCircleMetric_name(int argc, VALUE *argv, VALUE self) {
  Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__GreatCircleMetric, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::GreatCircleMetric const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::GreatCircleMetric * >(argp1);
  {
    try {
      result = ((Xapian::GreatCircleMetric const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Xapian_GreatCircleMetric(void *self) {
    Xapian::GreatCircleMetric *arg1 = (Xapian::GreatCircleMetric *)self;
    delete arg1;
}

static swig_class SwigClassLatLongDistancePostingSource;

SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  double arg5 ;
  double arg6 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  double val6 ;
  int ecode6 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 5, argv[4] ));
  } 
  arg5 = static_cast< double >(val5);
  ecode6 = SWIG_AsVal_double(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 6, argv[5] ));
  } 
  arg6 = static_cast< double >(val6);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4,arg5,arg6);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  double arg5 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 5, argv[4] ));
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4,arg5);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistancePostingSource", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 5, argv[4] ));
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3,arg4,arg5);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  double arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  double arg3 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","LatLongDistancePostingSource", 3, argv[2] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongDistancePostingSource_allocate(VALUE self)
#else
_wrap_LatLongDistancePostingSource_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongDistancePostingSource);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistancePostingSource__SWIG_7(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistancePostingSource";
  Xapian::LatLongDistancePostingSource *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistancePostingSource", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistancePostingSource", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  {
    try {
      result = (Xapian::LatLongDistancePostingSource *)new Xapian::LatLongDistancePostingSource(arg1,(Xapian::LatLongCoords const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_LatLongDistancePostingSource(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[6];
  int ii;
  
  argc = nargs;
  if (argc > 6) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_LatLongDistancePostingSource__SWIG_7(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_LatLongDistancePostingSource__SWIG_3(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_LatLongDistancePostingSource__SWIG_6(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_LatLongDistancePostingSource__SWIG_2(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_LatLongDistancePostingSource__SWIG_5(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_LatLongDistancePostingSource__SWIG_1(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_double(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_LatLongDistancePostingSource__SWIG_4(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                int res = SWIG_AsVal_double(argv[5], NULL);
                _v = SWIG_CheckState(res);
              }
              if (_v) {
                return _wrap_new_LatLongDistancePostingSource__SWIG_0(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 6, "LatLongDistancePostingSource.new", 
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_, double max_range_, double k1_, double k2_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_, double max_range_, double k1_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_, double max_range_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, double max_range_, double k1_, double k2_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, double max_range_, double k1_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, double max_range_)\n"
    "    LatLongDistancePostingSource.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_LatLongDistancePostingSource(void *self) {
    Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_next(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  double arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource *","next", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","next", 2, argv[0] ));
  } 
  arg2 = static_cast< double >(val2);
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_skip_to(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource *","skip_to", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","skip_to", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","skip_to", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_check(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::docid arg2 ;
  double arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource *","check", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","check", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","check", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_weight(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource const *","get_weight", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  {
    try {
      result = (double)((Xapian::LatLongDistancePostingSource const *)arg1)->get_weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_name(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource const *","name", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  {
    try {
      result = ((Xapian::LatLongDistancePostingSource const *)arg1)->name();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_init(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","init", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","init", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_LatLongDistancePostingSource_description(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistancePostingSource *arg1 = (Xapian::LatLongDistancePostingSource *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistancePostingSource, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistancePostingSource const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistancePostingSource * >(argp1);
  {
    try {
      result = ((Xapian::LatLongDistancePostingSource const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassLatLongDistanceKeyMaker;

SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistanceKeyMaker", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoords *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoords,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoords const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoords * >(argp2);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoords const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  double arg4 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  double val4 ;
  int ecode4 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  ecode4 = SWIG_AsVal_double(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","LatLongDistanceKeyMaker", 4, argv[3] ));
  } 
  arg4 = static_cast< double >(val4);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongMetric const &)*arg3,arg4);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  Xapian::LatLongMetric *arg3 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Xapian__LatLongMetric,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongMetric const &","LatLongDistanceKeyMaker", 3, argv[2])); 
  }
  arg3 = reinterpret_cast< Xapian::LatLongMetric * >(argp3);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2,(Xapian::LatLongMetric const &)*arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_LatLongDistanceKeyMaker_allocate(VALUE self)
#else
_wrap_LatLongDistanceKeyMaker_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_LatLongDistanceKeyMaker__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::valueno arg1 ;
  Xapian::LatLongCoord *arg2 = 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::LatLongDistanceKeyMaker";
  Xapian::LatLongDistanceKeyMaker *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Xapian::valueno","LatLongDistanceKeyMaker", 1, argv[0] ));
  } 
  arg1 = static_cast< Xapian::valueno >(val1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_Xapian__LatLongCoord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::LatLongCoord const &","LatLongDistanceKeyMaker", 2, argv[1])); 
  }
  arg2 = reinterpret_cast< Xapian::LatLongCoord * >(argp2);
  {
    try {
      result = (Xapian::LatLongDistanceKeyMaker *)new Xapian::LatLongDistanceKeyMaker(arg1,(Xapian::LatLongCoord const &)*arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_LatLongDistanceKeyMaker(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs;
  if (argc > 4) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_LatLongDistanceKeyMaker__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoord, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_LatLongDistanceKeyMaker__SWIG_5(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoord, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_LatLongDistanceKeyMaker__SWIG_4(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_new_LatLongDistanceKeyMaker__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoords, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_LatLongDistanceKeyMaker__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Xapian__LatLongCoord, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__LatLongMetric, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_new_LatLongDistanceKeyMaker__SWIG_3(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "LatLongDistanceKeyMaker.new", 
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_, double defdistance)\n"
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_, Xapian::LatLongMetric const &metric_)\n"
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoords const &centre_)\n"
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoord const &centre_, Xapian::LatLongMetric const &metric_, double defdistance)\n"
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoord const &centre_, Xapian::LatLongMetric const &metric_)\n"
    "    LatLongDistanceKeyMaker.new(Xapian::valueno slot_, Xapian::LatLongCoord const &centre_)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_LatLongDistanceKeyMaker(void *self) {
    Xapian::LatLongDistanceKeyMaker *arg1 = (Xapian::LatLongDistanceKeyMaker *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_LatLongDistanceKeyMaker___call__(int argc, VALUE *argv, VALUE self) {
  Xapian::LatLongDistanceKeyMaker *arg1 = (Xapian::LatLongDistanceKeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::LatLongDistanceKeyMaker const *","operator ()", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::LatLongDistanceKeyMaker * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","operator ()", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","operator ()", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      result = ((Xapian::LatLongDistanceKeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassDatabase;

SWIGINTERN VALUE
_wrap_Database_add_database(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","add_database", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Database const &","add_database", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Database const &","add_database", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}



/*
  Document-method: Xapian::Database.size

  call-seq:
    size -> size_t

Size or Length of the Database.
*/
SWIGINTERN VALUE
_wrap_Database_size(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","size", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->size();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Database__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::Database";
  Xapian::Database *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Database__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Database";
  Xapian::Database *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Database", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Database", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Database", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Database__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::Database";
  Xapian::Database *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Database", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Database", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_Database__SWIG_3(int argc, VALUE *argv, VALUE self) {
  int arg1 ;
  int arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Database";
  Xapian::Database *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Database", 1, argv[0] ));
  } 
  arg1 = static_cast< int >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Database", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database(arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_Database_allocate(VALUE self)
#else
_wrap_Database_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__Database);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_Database__SWIG_4(int argc, VALUE *argv, VALUE self) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::Database";
  Xapian::Database *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Database", 1, argv[0] ));
  } 
  arg1 = static_cast< int >(val1);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database(arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_Database(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_Database__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_Database__SWIG_4(nargs, args, self);
    }
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Database__SWIG_2(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_Database__SWIG_3(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_Database__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "Database.new", 
    "    Database.new()\n"
    "    Database.new(std::string const &path, int flags)\n"
    "    Database.new(std::string const &path)\n"
    "    Database.new(int fd, int flags)\n"
    "    Database.new(int fd)\n");
  
  return Qnil;
}


SWIGINTERN void
free_Xapian_Database(void *self) {
    Xapian::Database *arg1 = (Xapian::Database *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_Database_reopen(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","reopen", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (bool)(arg1)->reopen();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_close(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","close", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      (arg1)->close();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_description(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_postlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::PostingIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","postlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","postlist_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","postlist_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::PostingIterator(static_cast< const Xapian::PostingIterator& >(result))), SWIGTYPE_p_Xapian__PostingIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_postlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::PostingIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","postlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","postlist_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","postlist_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::PostingIterator(static_cast< const Xapian::PostingIterator& >(result))), SWIGTYPE_p_Xapian__PostingIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_termlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","termlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","termlist_begin", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_termlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","termlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","termlist_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_has_positions(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","has_positions", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->has_positions();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_positionlist_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","positionlist_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","positionlist_begin", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","positionlist_begin", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","positionlist_begin", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_positionlist_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  Xapian::PositionIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","positionlist_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","positionlist_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","positionlist_end", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","positionlist_end", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
  vresult = SWIG_NewPointerObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res3)) delete arg3;
  return vresult;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_allterms_begin__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","allterms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","allterms_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","allterms_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_allterms_begin__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","allterms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_allterms_begin(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_allterms_begin__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_allterms_begin__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_allterms_begin", 
    "    Xapian::TermIterator Database._dangerous_allterms_begin(std::string const &prefix)\n"
    "    Xapian::TermIterator Database._dangerous_allterms_begin()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_allterms_end__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","allterms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","allterms_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","allterms_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->allterms_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_allterms_end__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","allterms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  result = ((Xapian::Database const *)arg1)->allterms_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_allterms_end(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_allterms_end__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_allterms_end__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_allterms_end", 
    "    Xapian::TermIterator Database._dangerous_allterms_end(std::string const &)\n"
    "    Xapian::TermIterator Database._dangerous_allterms_end()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_doccount(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_doccount", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_doccount();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_lastdocid(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_lastdocid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::docid)((Xapian::Database const *)arg1)->get_lastdocid();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_avlength(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::doclength result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_avlength", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_avlength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_average_length(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_average_length", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (double)((Xapian::Database const *)arg1)->get_average_length();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_double(static_cast< double >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_total_length(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::totallength result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_total_length", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::totallength)((Xapian::Database const *)arg1)->get_total_length();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_termfreq(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_termfreq", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_termfreq", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_termfreq", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_term_exists(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","term_exists", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","term_exists", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","term_exists", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_collection_freq(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_collection_freq", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_collection_freq", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_collection_freq", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_value_freq(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::doccount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_value_freq", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","get_value_freq", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_value_freq(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_value_lower_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_value_lower_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","get_value_lower_bound", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_lower_bound(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_value_upper_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_value_upper_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","get_value_upper_bound", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_upper_bound(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_doclength_lower_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_doclength_lower_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_lower_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_doclength_upper_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_doclength_upper_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_upper_bound();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_wdf_upper_bound(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_wdf_upper_bound", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_wdf_upper_bound", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_wdf_upper_bound", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_wdf_upper_bound((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_valuestream_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::ValueIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","valuestream_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","valuestream_begin", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->valuestream_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_valuestream_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::ValueIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","valuestream_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::valueno","valuestream_end", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  result = ((Xapian::Database const *)arg1)->valuestream_end(arg2);
  vresult = SWIG_NewPointerObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_doclength(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_doclength", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_doclength", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_unique_terms(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::termcount result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_unique_terms", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_unique_terms", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_unique_terms(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_keep_alive(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","keep_alive", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      (arg1)->keep_alive();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_document__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::Document result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_document__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  unsigned int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::Document result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","get_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","get_document", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_document(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database_document(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Database_document__SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Database_document__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Database.document", 
    "    Xapian::Document Database.document(Xapian::docid did)\n"
    "    Xapian::Document Database.document(Xapian::docid did, unsigned int flags)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_spelling_suggestion__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_spelling_suggestion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_spelling_suggestion", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_spelling_suggestion", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","get_spelling_suggestion", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_spelling_suggestion__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_spelling_suggestion", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_spelling_suggestion", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_spelling_suggestion", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database_get_spelling_suggestion(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database_get_spelling_suggestion__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Database_get_spelling_suggestion__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "Database.get_spelling_suggestion", 
    "    std::string Database.get_spelling_suggestion(std::string const &word, unsigned int max_edit_distance)\n"
    "    std::string Database.get_spelling_suggestion(std::string const &word)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_spellings_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","spellings_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->spellings_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_spellings_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","spellings_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  result = ((Xapian::Database const *)arg1)->spellings_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonyms_begin(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonyms_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","synonyms_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","synonyms_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonyms_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonyms_end(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonyms_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","synonyms_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","synonyms_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->synonyms_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonym_keys_begin__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonym_keys_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","synonym_keys_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","synonym_keys_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonym_keys_begin__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonym_keys_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_synonym_keys_begin(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_synonym_keys_begin__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_synonym_keys_begin__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_synonym_keys_begin", 
    "    Xapian::TermIterator Database._dangerous_synonym_keys_begin(std::string const &prefix)\n"
    "    Xapian::TermIterator Database._dangerous_synonym_keys_begin()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonym_keys_end__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonym_keys_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","synonym_keys_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","synonym_keys_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->synonym_keys_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_synonym_keys_end__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","synonym_keys_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  result = ((Xapian::Database const *)arg1)->synonym_keys_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_synonym_keys_end(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_synonym_keys_end__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_synonym_keys_end__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_synonym_keys_end", 
    "    Xapian::TermIterator Database._dangerous_synonym_keys_end(std::string const &)\n"
    "    Xapian::TermIterator Database._dangerous_synonym_keys_end()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_metadata(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_metadata", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","get_metadata", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","get_metadata", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_metadata((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_metadata_keys_begin__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","metadata_keys_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","metadata_keys_begin", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","metadata_keys_begin", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_metadata_keys_begin__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","metadata_keys_begin", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_metadata_keys_begin(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_metadata_keys_begin__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_metadata_keys_begin__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_metadata_keys_begin", 
    "    Xapian::TermIterator Database._dangerous_metadata_keys_begin(std::string const &prefix)\n"
    "    Xapian::TermIterator Database._dangerous_metadata_keys_begin()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_metadata_keys_end__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","metadata_keys_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","metadata_keys_end", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","metadata_keys_end", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  result = ((Xapian::Database const *)arg1)->metadata_keys_end((std::string const &)*arg2);
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database__dangerous_metadata_keys_end__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::TermIterator result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","metadata_keys_end", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  result = ((Xapian::Database const *)arg1)->metadata_keys_end();
  vresult = SWIG_NewPointerObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database__dangerous_metadata_keys_end(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database__dangerous_metadata_keys_end__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database__dangerous_metadata_keys_end__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "Database._dangerous_metadata_keys_end", 
    "    Xapian::TermIterator Database._dangerous_metadata_keys_end(std::string const &)\n"
    "    Xapian::TermIterator Database._dangerous_metadata_keys_end()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_uuid(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_uuid", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_uuid();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_locked(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","locked", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->locked();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_bool(static_cast< bool >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_get_revision(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Xapian::rev result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database const *","get_revision", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::rev)((Xapian::Database const *)arg1)->get_revision();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_check__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Database::check", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Database::check", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Xapian::Database::check", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = Xapian::Database::check((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_check__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Database::check", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Database::check", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Database::check((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_check__SWIG_2(int argc, VALUE *argv, VALUE self) {
  int arg1 ;
  int arg2 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Xapian::Database::check", 1, argv[0] ));
  } 
  arg1 = static_cast< int >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Xapian::Database::check", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = Xapian::Database::check(arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_check__SWIG_3(int argc, VALUE *argv, VALUE self) {
  int arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Xapian::Database::check", 1, argv[0] ));
  } 
  arg1 = static_cast< int >(val1);
  {
    try {
      result = Xapian::Database::check(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database_check(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_Database_check__SWIG_3(nargs, args, self);
    }
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Database_check__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Database_check__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Database_check__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "Database.check", 
    "    size_t Database.check(std::string const &path, int opts)\n"
    "    size_t Database.check(std::string const &path)\n"
    "    size_t Database.check(int fd, int opts)\n"
    "    size_t Database.check(int fd)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","compact", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","compact", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","compact", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      (arg1)->compact((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","compact", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","compact", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      (arg1)->compact((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_2(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","compact", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","compact", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->compact((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_3(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","compact", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","compact", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      (arg1)->compact(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_4(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","compact", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  {
    try {
      (arg1)->compact(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_5(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","compact", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      (arg1)->compact(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_6(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  int arg4 ;
  Xapian::Compactor *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","compact", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","compact", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","compact", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_Xapian__Compactor,  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::Compactor &","compact", 5, argv[3] )); 
  }
  if (!argp5) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Compactor &","compact", 5, argv[3])); 
  }
  arg5 = reinterpret_cast< Xapian::Compactor * >(argp5);
  {
    try {
      (arg1)->compact((std::string const &)*arg2,arg3,arg4,*arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Database_compact__SWIG_7(int argc, VALUE *argv, VALUE self) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  int arg2 ;
  unsigned int arg3 ;
  int arg4 ;
  Xapian::Compactor *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::Database *","compact", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","compact", 2, argv[0] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","compact", 3, argv[1] ));
  } 
  arg3 = static_cast< unsigned int >(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","compact", 4, argv[2] ));
  } 
  arg4 = static_cast< int >(val4);
  res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_Xapian__Compactor,  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "Xapian::Compactor &","compact", 5, argv[3] )); 
  }
  if (!argp5) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Compactor &","compact", 5, argv[3])); 
  }
  arg5 = reinterpret_cast< Xapian::Compactor * >(argp5);
  {
    try {
      (arg1)->compact(arg2,arg3,arg4,*arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Database_compact(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[6];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 6) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Database_compact__SWIG_5(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Database_compact__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Database_compact__SWIG_4(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Database_compact__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Database_compact__SWIG_3(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Database_compact__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__Compactor, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              return _wrap_Database_compact__SWIG_7(nargs, args, self);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Database, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            void *vptr = 0;
            int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Xapian__Compactor, 0);
            _v = SWIG_CheckState(res);
            if (_v) {
              return _wrap_Database_compact__SWIG_6(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 6, "Database.compact", 
    "    void Database.compact(std::string const &output, unsigned int flags, int block_size)\n"
    "    void Database.compact(std::string const &output, unsigned int flags)\n"
    "    void Database.compact(std::string const &output)\n"
    "    void Database.compact(int fd, unsigned int flags, int block_size)\n"
    "    void Database.compact(int fd, unsigned int flags)\n"
    "    void Database.compact(int fd)\n"
    "    void Database.compact(std::string const &output, unsigned int flags, int block_size, Xapian::Compactor &compactor)\n"
    "    void Database.compact(int fd, unsigned int flags, int block_size, Xapian::Compactor &compactor)\n");
  
  return Qnil;
}


static swig_class SwigClassWritableDatabase;

SWIGINTERN void
free_Xapian_WritableDatabase(void *self) {
    Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *)self;
    delete arg1;
}

SWIGINTERN VALUE
_wrap_new_WritableDatabase__SWIG_0(int argc, VALUE *argv, VALUE self) {
  const char *classname SWIGUNUSED = "Xapian::WritableDatabase";
  Xapian::WritableDatabase *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_WritableDatabase__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::WritableDatabase";
  Xapian::WritableDatabase *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","WritableDatabase", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","WritableDatabase", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","WritableDatabase", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","WritableDatabase", 3, argv[2] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2,arg3);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_new_WritableDatabase__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  const char *classname SWIGUNUSED = "Xapian::WritableDatabase";
  Xapian::WritableDatabase *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","WritableDatabase", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","WritableDatabase", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","WritableDatabase", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
_wrap_WritableDatabase_allocate(VALUE self)
#else
_wrap_WritableDatabase_allocate(int argc, VALUE *argv, VALUE self)
#endif
{
  VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Xapian__WritableDatabase);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  rb_obj_call_init(vresult, argc, argv);
#endif
  return vresult;
}


SWIGINTERN VALUE
_wrap_new_WritableDatabase__SWIG_3(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  const char *classname SWIGUNUSED = "Xapian::WritableDatabase";
  Xapian::WritableDatabase *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","WritableDatabase", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","WritableDatabase", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1);
      DATA_PTR(self) = result;
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res1)) delete arg1;
  return self;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_WritableDatabase(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_WritableDatabase__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_WritableDatabase__SWIG_3(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_WritableDatabase__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_WritableDatabase__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "WritableDatabase.new", 
    "    WritableDatabase.new()\n"
    "    WritableDatabase.new(std::string const &path, int flags, int block_size)\n"
    "    WritableDatabase.new(std::string const &path, int flags)\n"
    "    WritableDatabase.new(std::string const &path)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_add_database(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::WritableDatabase *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","add_database", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__WritableDatabase,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const &","add_database", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::WritableDatabase const &","add_database", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::WritableDatabase * >(argp2);
  {
    try {
      (arg1)->add_database((Xapian::WritableDatabase const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_commit(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","commit", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->commit();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_flush(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","flush", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->flush();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_begin_transaction__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","begin_transaction", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","begin_transaction", 2, argv[0] ));
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      (arg1)->begin_transaction(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_begin_transaction__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","begin_transaction", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->begin_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_WritableDatabase_begin_transaction(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_WritableDatabase_begin_transaction__SWIG_1(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_bool(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_WritableDatabase_begin_transaction__SWIG_0(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "WritableDatabase.begin_transaction", 
    "    void WritableDatabase.begin_transaction(bool flushed)\n"
    "    void WritableDatabase.begin_transaction()\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_commit_transaction(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","commit_transaction", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->commit_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_cancel_transaction(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","cancel_transaction", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->cancel_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_add_document(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","add_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Xapian::Document const &","add_document", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","add_document", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_delete_document__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","delete_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","delete_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->delete_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_delete_document__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","delete_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","delete_document", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","delete_document", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_WritableDatabase_delete_document(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 3) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_0(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "WritableDatabase.delete_document", 
    "    void WritableDatabase.delete_document(Xapian::docid did)\n"
    "    void WritableDatabase.delete_document(std::string const &unique_term)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_replace_document__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","replace_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Xapian::docid","replace_document", 2, argv[0] ));
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::Document const &","replace_document", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","replace_document", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::Document * >(argp3);
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_replace_document__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 ;
  int res3 = 0 ;
  Xapian::docid result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","replace_document", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","replace_document", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","replace_document", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Xapian::Document const &","replace_document", 3, argv[1] )); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Xapian::Document const &","replace_document", 3, argv[1])); 
  }
  arg3 = reinterpret_cast< Xapian::Document * >(argp3);
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_WritableDatabase_replace_document(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__Document, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_WritableDatabase_replace_document__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__Document, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_WritableDatabase_replace_document__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "WritableDatabase.replace_document", 
    "    void WritableDatabase.replace_document(Xapian::docid did, Xapian::Document const &document)\n"
    "    Xapian::docid WritableDatabase.replace_document(std::string const &unique_term, Xapian::Document const &document)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_add_spelling__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","add_spelling", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_spelling", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_spelling", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","add_spelling", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_add_spelling__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","add_spelling", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_spelling", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_spelling", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_WritableDatabase_add_spelling(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_WritableDatabase_add_spelling__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_WritableDatabase_add_spelling__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "WritableDatabase.add_spelling", 
    "    void WritableDatabase.add_spelling(std::string const &word, Xapian::termcount freqinc)\n"
    "    void WritableDatabase.add_spelling(std::string const &word)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_remove_spelling__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","remove_spelling", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_spelling", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_spelling", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Xapian::termcount","remove_spelling", 3, argv[1] ));
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_remove_spelling__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","remove_spelling", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_spelling", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_spelling", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_WritableDatabase_remove_spelling(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_WritableDatabase_remove_spelling__SWIG_1(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__WritableDatabase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_WritableDatabase_remove_spelling__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "WritableDatabase.remove_spelling", 
    "    void WritableDatabase.remove_spelling(std::string const &word, Xapian::termcount freqdec)\n"
    "    void WritableDatabase.remove_spelling(std::string const &word)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_add_synonym(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","add_synonym", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","add_synonym", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_synonym", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","add_synonym", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","add_synonym", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_remove_synonym(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","remove_synonym", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","remove_synonym", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_synonym", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","remove_synonym", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","remove_synonym", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_clear_synonyms(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","clear_synonyms", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","clear_synonyms", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","clear_synonyms", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->clear_synonyms((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_set_metadata(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase *","set_metadata", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","set_metadata", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_metadata", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","set_metadata", 3, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","set_metadata", 3, argv[1])); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->set_metadata((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_WritableDatabase_description(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Xapian::WritableDatabase const *","get_description", 1, self )); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      result = ((Xapian::WritableDatabase const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_From_std_string(static_cast< std::string >(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_open_stub__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Auto::open_stub", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Auto::open_stub", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Auto::open_stub((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_open_stub__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Auto::open_stub", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Auto::open_stub", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Xapian::Auto::open_stub", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = Xapian::Auto::open_stub((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE _wrap_open_stub(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_open_stub__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_open_stub__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "open_stub", 
    "    Xapian::Database open_stub(std::string const &file)\n"
    "    Xapian::WritableDatabase open_stub(std::string const &file, int action)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_inmemory_open(int argc, VALUE *argv, VALUE self) {
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    try {
      result = Xapian::InMemory::open();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_chert_open__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Chert::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Chert::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_chert_open__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Chert::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Chert::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Xapian::Chert::open", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Xapian::Chert::open", 3, argv[2] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_chert_open__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Chert::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Chert::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Xapian::Chert::open", 2, argv[1] ));
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE _wrap_chert_open(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[3];
  int ii;
  
  argc = nargs;
  if (argc > 3) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_chert_open__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_chert_open__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_chert_open__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 3, "chert_open", 
    "    Xapian::Database chert_open(std::string const &dir)\n"
    "    Xapian::WritableDatabase chert_open(std::string const &dir, int action, int block_size)\n"
    "    Xapian::WritableDatabase chert_open(std::string const &dir, int action)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  useconds_t arg4 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open", 4, argv[3] ));
  } 
  arg4 = static_cast< useconds_t >(val4);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_0(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  useconds_t arg4 ;
  int arg5 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 5) || (argc > 5)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open_writable", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 4, argv[3] ));
  } 
  arg4 = static_cast< useconds_t >(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","Xapian::Remote::open_writable", 5, argv[4] ));
  } 
  arg5 = static_cast< int >(val5);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3,arg4,arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_1(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  useconds_t arg4 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open_writable", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 4, argv[3] ));
  } 
  arg4 = static_cast< useconds_t >(val4);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_2(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  useconds_t arg3 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open_writable", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_3(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Xapian::Remote::open_writable", 2, argv[1] ));
  } 
  arg2 = static_cast< unsigned int >(val2);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open__SWIG_3(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  useconds_t arg3 ;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open__SWIG_4(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::Database result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_remote_open(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs;
  if (argc > 4) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_remote_open__SWIG_2(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_remote_open__SWIG_4(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_remote_open__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_remote_open__SWIG_3(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_remote_open__SWIG_0(nargs, args, self);
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "remote_open", 
    "    Xapian::Database remote_open(std::string const &host, unsigned int port, useconds_t timeout, useconds_t connect_timeout)\n"
    "    Xapian::Database remote_open(std::string const &host, unsigned int port, useconds_t timeout)\n"
    "    Xapian::Database remote_open(std::string const &host, unsigned int port)\n"
    "    Xapian::Database remote_open(std::string const &program, std::string const &args, useconds_t timeout)\n"
    "    Xapian::Database remote_open(std::string const &program, std::string const &args)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_4(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  useconds_t arg3 ;
  int arg4 ;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Xapian::Remote::open_writable", 4, argv[3] ));
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_5(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  useconds_t arg3 ;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "useconds_t","Xapian::Remote::open_writable", 3, argv[2] ));
  } 
  arg3 = static_cast< useconds_t >(val3);
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE
_wrap_remote_open_writable__SWIG_6(int argc, VALUE *argv, VALUE self) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  Xapian::WritableDatabase result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string(argv[0], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 1, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 1, argv[0])); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","Xapian::Remote::open_writable", 2, argv[1] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","Xapian::Remote::open_writable", 2, argv[1])); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      SWIG_exception(code, msg.c_str());
    }
  }
  vresult = SWIG_NewPointerObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN |  0 );
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return vresult;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}


SWIGINTERN VALUE _wrap_remote_open_writable(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[5];
  int ii;
  
  argc = nargs;
  if (argc > 5) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_remote_open_writable__SWIG_3(nargs, args, self);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_remote_open_writable__SWIG_6(nargs, args, self);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_remote_open_writable__SWIG_2(nargs, args, self);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_remote_open_writable__SWIG_5(nargs, args, self);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_remote_open_writable__SWIG_1(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_remote_open_writable__SWIG_4(nargs, args, self);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_int(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_remote_open_writable__SWIG_0(nargs, args, self);
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 5, "remote_open_writable", 
    "    Xapian::WritableDatabase remote_open_writable(std::string const &host, unsigned int port, useconds_t timeout, useconds_t connect_timeout, int flags)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &host, unsigned int port, useconds_t timeout, useconds_t connect_timeout)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &host, unsigned int port, useconds_t timeout)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &host, unsigned int port)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &program, std::string const &args, useconds_t timeout, int flags)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &program, std::string const &args, useconds_t timeout)\n"
    "    Xapian::WritableDatabase remote_open_writable(std::string const &program, std::string const &args)\n");
  
  return Qnil;
}



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

static void *_p_swig__IteratorTo_p_swig__ConstIterator(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((swig::ConstIterator *)  ((swig::Iterator *) x));
}
static void *_p_Xapian__WritableDatabaseTo_p_Xapian__Database(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Database *)  ((Xapian::WritableDatabase *) x));
}
static void *_p_Xapian__GreatCircleMetricTo_p_Xapian__LatLongMetric(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::LatLongMetric *)  ((Xapian::GreatCircleMetric *) x));
}
static void *_p_Xapian__ExpandDeciderFilterPrefixTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderFilterPrefix *) x));
}
static void *_p_Xapian__ExpandDeciderAndTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderAnd *) x));
}
static void *_p_Xapian__ExpandDeciderFilterTermsTo_p_Xapian__ExpandDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ExpandDecider *)  ((Xapian::ExpandDeciderFilterTerms *) x));
}
static void *_p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchDecider *)  ((Xapian::ValueSetMatchDecider *) x));
}
static void *_p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::MultiValueKeyMaker *) x));
}
static void *_p_Xapian__LatLongDistanceKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::LatLongDistanceKeyMaker *) x));
}
static void *_p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::ValuePostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *)(Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::FixedWeightPostingSource *) x));
}
static void *_p_Xapian__LatLongDistancePostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::LatLongDistancePostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueWeightPostingSource *)  ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *) (Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__LatLongDistancePostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::LatLongDistancePostingSource *) x));
}
static void *_p_Xapian__DPHWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::DPHWeight *) x));
}
static void *_p_Xapian__PL2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::PL2Weight *) x));
}
static void *_p_Xapian__DLHWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::DLHWeight *) x));
}
static void *_p_Xapian__BB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BB2Weight *) x));
}
static void *_p_Xapian__IneB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::IneB2Weight *) x));
}
static void *_p_Xapian__IfB2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::IfB2Weight *) x));
}
static void *_p_Xapian__InL2WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::InL2Weight *) x));
}
static void *_p_Xapian__TradWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::TradWeight *) x));
}
static void *_p_Xapian__TfIdfWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::TfIdfWeight *) x));
}
static void *_p_Xapian__BoolWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BoolWeight *) x));
}
static void *_p_Xapian__CoordWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::CoordWeight *) x));
}
static void *_p_Xapian__LMWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::LMWeight *) x));
}
static void *_p_Xapian__PL2PlusWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::PL2PlusWeight *) x));
}
static void *_p_Xapian__BM25PlusWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25PlusWeight *) x));
}
static void *_p_Xapian__BM25WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25Weight *) x));
}
static void *_p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchSpy *)  ((Xapian::ValueCountMatchSpy *) x));
}
static void *_p_Xapian__SimpleStopperTo_p_Xapian__Stopper(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Stopper *)  ((Xapian::SimpleStopper *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::NumberValueRangeProcessor *) x));
}
static void *_p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *)  ((Xapian::StringValueRangeProcessor *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::NumberValueRangeProcessor *) x));
}
static void *_p_Xapian__DateRangeProcessorTo_p_Xapian__RangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RangeProcessor *)  ((Xapian::DateRangeProcessor *) x));
}
static void *_p_Xapian__NumberRangeProcessorTo_p_Xapian__RangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::RangeProcessor *)  ((Xapian::NumberRangeProcessor *) x));
}
static swig_type_info _swigt__p_Xapian__BB2Weight = {"_p_Xapian__BB2Weight", "Xapian::BB2Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__BM25PlusWeight = {"_p_Xapian__BM25PlusWeight", "Xapian::BM25PlusWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__BM25Weight = {"_p_Xapian__BM25Weight", "Xapian::BM25Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__BoolWeight = {"_p_Xapian__BoolWeight", "Xapian::BoolWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Compactor = {"_p_Xapian__Compactor", "Xapian::Compactor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__CoordWeight = {"_p_Xapian__CoordWeight", "Xapian::CoordWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DLHWeight = {"_p_Xapian__DLHWeight", "Xapian::DLHWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DPHWeight = {"_p_Xapian__DPHWeight", "Xapian::DPHWeight *", 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__DateRangeProcessor = {"_p_Xapian__DateRangeProcessor", "Xapian::DateRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DateValueRangeProcessor = {"_p_Xapian__DateValueRangeProcessor", "Xapian::DateValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DecreasingValueWeightPostingSource = {"_p_Xapian__DecreasingValueWeightPostingSource", "Xapian::DecreasingValueWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Document = {"_p_Xapian__Document", "Xapian::Document *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ESet = {"_p_Xapian__ESet", "Xapian::ESet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ESetIterator = {"_p_Xapian__ESetIterator", "Xapian::ESetIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Enquire = {"_p_Xapian__Enquire", "Xapian::Enquire *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDecider = {"_p_Xapian__ExpandDecider", "Xapian::ExpandDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderFilterTerms = {"_p_Xapian__ExpandDeciderFilterTerms", 0, 0, 0, 0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderAnd = {"_p_Xapian__ExpandDeciderAnd", "Xapian::ExpandDeciderAnd *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDeciderFilterPrefix = {"_p_Xapian__ExpandDeciderFilterPrefix", "Xapian::ExpandDeciderFilterPrefix *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__FieldProcessor = {"_p_Xapian__FieldProcessor", "Xapian::FieldProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__FixedWeightPostingSource = {"_p_Xapian__FixedWeightPostingSource", "Xapian::FixedWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__GreatCircleMetric = {"_p_Xapian__GreatCircleMetric", "Xapian::GreatCircleMetric *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__IfB2Weight = {"_p_Xapian__IfB2Weight", "Xapian::IfB2Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__InL2Weight = {"_p_Xapian__InL2Weight", "Xapian::InL2Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__IneB2Weight = {"_p_Xapian__IneB2Weight", "Xapian::IneB2Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__KeyMaker = {"_p_Xapian__KeyMaker", "Xapian::KeyMaker *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LMWeight = {"_p_Xapian__LMWeight", "Xapian::LMWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoord = {"_p_Xapian__LatLongCoord", "Xapian::LatLongCoord *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoords = {"_p_Xapian__LatLongCoords", "Xapian::LatLongCoords *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongCoordsIterator = {"_p_Xapian__LatLongCoordsIterator", "Xapian::LatLongCoordsIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongDistanceKeyMaker = {"_p_Xapian__LatLongDistanceKeyMaker", "Xapian::LatLongDistanceKeyMaker *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongDistancePostingSource = {"_p_Xapian__LatLongDistancePostingSource", "Xapian::LatLongDistancePostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__LatLongMetric = {"_p_Xapian__LatLongMetric", "Xapian::LatLongMetric *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MSet = {"_p_Xapian__MSet", "Xapian::MSet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MSetIterator = {"_p_Xapian__MSetIterator", "Xapian::MSetIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MatchDecider = {"_p_Xapian__MatchDecider", "Xapian::MatchDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MatchSpy = {"_p_Xapian__MatchSpy", "Xapian::MatchSpy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MultiValueKeyMaker = {"_p_Xapian__MultiValueKeyMaker", "Xapian::MultiValueKeyMaker *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__NumberRangeProcessor = {"_p_Xapian__NumberRangeProcessor", "Xapian::NumberRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__NumberValueRangeProcessor = {"_p_Xapian__NumberValueRangeProcessor", "Xapian::NumberValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PL2PlusWeight = {"_p_Xapian__PL2PlusWeight", "Xapian::PL2PlusWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PL2Weight = {"_p_Xapian__PL2Weight", "Xapian::PL2Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PositionIterator = {"_p_Xapian__PositionIterator", "Xapian::PositionIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PostingIterator = {"_p_Xapian__PostingIterator", "Xapian::PostingIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PostingSource = {"_p_Xapian__PostingSource", "Xapian::PostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Query = {"_p_Xapian__Query", "Xapian::Query *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__QueryParser = {"_p_Xapian__QueryParser", "Xapian::QueryParser *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__RSet = {"_p_Xapian__RSet", "Xapian::RSet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__RangeProcessor = {"_p_Xapian__RangeProcessor", "Xapian::RangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Registry = {"_p_Xapian__Registry", "Xapian::Registry *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__SimpleStopper = {"_p_Xapian__SimpleStopper", "Xapian::SimpleStopper *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Stem = {"_p_Xapian__Stem", "Xapian::Stem *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__StemImplementation = {"_p_Xapian__StemImplementation", "Xapian::StemImplementation *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Stopper = {"_p_Xapian__Stopper", "Xapian::Stopper *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__StringValueRangeProcessor = {"_p_Xapian__StringValueRangeProcessor", "Xapian::StringValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TermGenerator = {"_p_Xapian__TermGenerator", "Xapian::TermGenerator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TermIterator = {"_p_Xapian__TermIterator", "Xapian::TermIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TfIdfWeight = {"_p_Xapian__TfIdfWeight", "Xapian::TfIdfWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TradWeight = {"_p_Xapian__TradWeight", "Xapian::TradWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueCountMatchSpy = {"_p_Xapian__ValueCountMatchSpy", "Xapian::ValueCountMatchSpy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueIterator = {"_p_Xapian__ValueIterator", "Xapian::ValueIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueMapPostingSource = {"_p_Xapian__ValueMapPostingSource", "Xapian::ValueMapPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValuePostingSource = {"_p_Xapian__ValuePostingSource", "Xapian::ValuePostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueRangeProcessor = {"_p_Xapian__ValueRangeProcessor", "Xapian::ValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueSetMatchDecider = {"_p_Xapian__ValueSetMatchDecider", "Xapian::ValueSetMatchDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueWeightPostingSource = {"_p_Xapian__ValueWeightPostingSource", "Xapian::ValueWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Weight = {"_p_Xapian__Weight", "Xapian::Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__WritableDatabase = {"_p_Xapian__WritableDatabase", "Xapian::WritableDatabase *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_compaction_level = {"_p_compaction_level", "compaction_level *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_docid_order = {"_p_docid_order", "docid_order *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "Xapian::doclength *|double *|Xapian::weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_feature_flag = {"_p_feature_flag", "feature_flag *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_flags = {"_p_flags", "flags *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *|Xapian::doccount_diff *|Xapian::termcount_diff *|Xapian::termpos_diff *|Xapian::valueno_diff *|Xapian::percent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_stem_strategy = {"_p_stem_strategy", "stem_strategy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_stop_strategy = {"_p_stop_strategy", "stop_strategy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_swig__ConstIterator = {"_p_swig__ConstIterator", "swig::ConstIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_swig__GC_VALUE = {"_p_swig__GC_VALUE", "swig::GC_VALUE *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_swig__Iterator = {"_p_swig__Iterator", "swig::Iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_type_smoothing = {"_p_type_smoothing", "type_smoothing *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "Xapian::timeout *|unsigned int *|Xapian::doccount *|Xapian::termcount *|Xapian::valueno *|Xapian::docid *|Xapian::termpos *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "Xapian::rev *|unsigned long *|Xapian::totallength *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_void = {"_p_void", "VALUE|void *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_Xapian__BB2Weight,
  &_swigt__p_Xapian__BM25PlusWeight,
  &_swigt__p_Xapian__BM25Weight,
  &_swigt__p_Xapian__BoolWeight,
  &_swigt__p_Xapian__Compactor,
  &_swigt__p_Xapian__CoordWeight,
  &_swigt__p_Xapian__DLHWeight,
  &_swigt__p_Xapian__DPHWeight,
  &_swigt__p_Xapian__Database,
  &_swigt__p_Xapian__DateRangeProcessor,
  &_swigt__p_Xapian__DateValueRangeProcessor,
  &_swigt__p_Xapian__DecreasingValueWeightPostingSource,
  &_swigt__p_Xapian__Document,
  &_swigt__p_Xapian__ESet,
  &_swigt__p_Xapian__ESetIterator,
  &_swigt__p_Xapian__Enquire,
  &_swigt__p_Xapian__ExpandDecider,
  &_swigt__p_Xapian__ExpandDeciderAnd,
  &_swigt__p_Xapian__ExpandDeciderFilterPrefix,
  &_swigt__p_Xapian__ExpandDeciderFilterTerms,
  &_swigt__p_Xapian__FieldProcessor,
  &_swigt__p_Xapian__FixedWeightPostingSource,
  &_swigt__p_Xapian__GreatCircleMetric,
  &_swigt__p_Xapian__IfB2Weight,
  &_swigt__p_Xapian__InL2Weight,
  &_swigt__p_Xapian__IneB2Weight,
  &_swigt__p_Xapian__KeyMaker,
  &_swigt__p_Xapian__LMWeight,
  &_swigt__p_Xapian__LatLongCoord,
  &_swigt__p_Xapian__LatLongCoords,
  &_swigt__p_Xapian__LatLongCoordsIterator,
  &_swigt__p_Xapian__LatLongDistanceKeyMaker,
  &_swigt__p_Xapian__LatLongDistancePostingSource,
  &_swigt__p_Xapian__LatLongMetric,
  &_swigt__p_Xapian__MSet,
  &_swigt__p_Xapian__MSetIterator,
  &_swigt__p_Xapian__MatchDecider,
  &_swigt__p_Xapian__MatchSpy,
  &_swigt__p_Xapian__MultiValueKeyMaker,
  &_swigt__p_Xapian__NumberRangeProcessor,
  &_swigt__p_Xapian__NumberValueRangeProcessor,
  &_swigt__p_Xapian__PL2PlusWeight,
  &_swigt__p_Xapian__PL2Weight,
  &_swigt__p_Xapian__PositionIterator,
  &_swigt__p_Xapian__PostingIterator,
  &_swigt__p_Xapian__PostingSource,
  &_swigt__p_Xapian__Query,
  &_swigt__p_Xapian__QueryParser,
  &_swigt__p_Xapian__RSet,
  &_swigt__p_Xapian__RangeProcessor,
  &_swigt__p_Xapian__Registry,
  &_swigt__p_Xapian__SimpleStopper,
  &_swigt__p_Xapian__Stem,
  &_swigt__p_Xapian__StemImplementation,
  &_swigt__p_Xapian__Stopper,
  &_swigt__p_Xapian__StringValueRangeProcessor,
  &_swigt__p_Xapian__TermGenerator,
  &_swigt__p_Xapian__TermIterator,
  &_swigt__p_Xapian__TfIdfWeight,
  &_swigt__p_Xapian__TradWeight,
  &_swigt__p_Xapian__ValueCountMatchSpy,
  &_swigt__p_Xapian__ValueIterator,
  &_swigt__p_Xapian__ValueMapPostingSource,
  &_swigt__p_Xapian__ValuePostingSource,
  &_swigt__p_Xapian__ValueRangeProcessor,
  &_swigt__p_Xapian__ValueSetMatchDecider,
  &_swigt__p_Xapian__ValueWeightPostingSource,
  &_swigt__p_Xapian__Weight,
  &_swigt__p_Xapian__WritableDatabase,
  &_swigt__p_char,
  &_swigt__p_compaction_level,
  &_swigt__p_docid_order,
  &_swigt__p_double,
  &_swigt__p_feature_flag,
  &_swigt__p_flags,
  &_swigt__p_int,
  &_swigt__p_std__string,
  &_swigt__p_stem_strategy,
  &_swigt__p_stop_strategy,
  &_swigt__p_swig__ConstIterator,
  &_swigt__p_swig__GC_VALUE,
  &_swigt__p_swig__Iterator,
  &_swigt__p_type_smoothing,
  &_swigt__p_unsigned_int,
  &_swigt__p_unsigned_long,
  &_swigt__p_void,
};

static swig_cast_info _swigc__p_Xapian__BB2Weight[] = {  {&_swigt__p_Xapian__BB2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BM25PlusWeight[] = {  {&_swigt__p_Xapian__BM25PlusWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BM25Weight[] = {  {&_swigt__p_Xapian__BM25Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BoolWeight[] = {  {&_swigt__p_Xapian__BoolWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Compactor[] = {  {&_swigt__p_Xapian__Compactor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__CoordWeight[] = {  {&_swigt__p_Xapian__CoordWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DLHWeight[] = {  {&_swigt__p_Xapian__DLHWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DPHWeight[] = {  {&_swigt__p_Xapian__DPHWeight, 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__DateRangeProcessor[] = {  {&_swigt__p_Xapian__DateRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DateValueRangeProcessor[] = {  {&_swigt__p_Xapian__DateValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DecreasingValueWeightPostingSource[] = {  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Document[] = {  {&_swigt__p_Xapian__Document, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESet[] = {  {&_swigt__p_Xapian__ESet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESetIterator[] = {  {&_swigt__p_Xapian__ESetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Enquire[] = {  {&_swigt__p_Xapian__Enquire, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDeciderFilterTerms[] = {{&_swigt__p_Xapian__ExpandDeciderFilterTerms, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDecider[] = {  {&_swigt__p_Xapian__ExpandDeciderFilterPrefix, _p_Xapian__ExpandDeciderFilterPrefixTo_p_Xapian__ExpandDecider, 0, 0},  {&_swigt__p_Xapian__ExpandDecider, 0, 0, 0},  {&_swigt__p_Xapian__ExpandDeciderAnd, _p_Xapian__ExpandDeciderAndTo_p_Xapian__ExpandDecider, 0, 0},  {&_swigt__p_Xapian__ExpandDeciderFilterTerms, _p_Xapian__ExpandDeciderFilterTermsTo_p_Xapian__ExpandDecider, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDeciderAnd[] = {  {&_swigt__p_Xapian__ExpandDeciderAnd, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDeciderFilterPrefix[] = {  {&_swigt__p_Xapian__ExpandDeciderFilterPrefix, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__FieldProcessor[] = {  {&_swigt__p_Xapian__FieldProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__FixedWeightPostingSource[] = {  {&_swigt__p_Xapian__FixedWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__GreatCircleMetric[] = {  {&_swigt__p_Xapian__GreatCircleMetric, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__IfB2Weight[] = {  {&_swigt__p_Xapian__IfB2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__InL2Weight[] = {  {&_swigt__p_Xapian__InL2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__IneB2Weight[] = {  {&_swigt__p_Xapian__IneB2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__KeyMaker[] = {  {&_swigt__p_Xapian__KeyMaker, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueKeyMaker, _p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__LatLongDistanceKeyMaker, _p_Xapian__LatLongDistanceKeyMakerTo_p_Xapian__KeyMaker, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LMWeight[] = {  {&_swigt__p_Xapian__LMWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoord[] = {  {&_swigt__p_Xapian__LatLongCoord, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoords[] = {  {&_swigt__p_Xapian__LatLongCoords, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongCoordsIterator[] = {  {&_swigt__p_Xapian__LatLongCoordsIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongDistanceKeyMaker[] = {  {&_swigt__p_Xapian__LatLongDistanceKeyMaker, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongDistancePostingSource[] = {  {&_swigt__p_Xapian__LatLongDistancePostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__LatLongMetric[] = {  {&_swigt__p_Xapian__LatLongMetric, 0, 0, 0},  {&_swigt__p_Xapian__GreatCircleMetric, _p_Xapian__GreatCircleMetricTo_p_Xapian__LatLongMetric, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSet[] = {  {&_swigt__p_Xapian__MSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSetIterator[] = {  {&_swigt__p_Xapian__MSetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchDecider[] = {  {&_swigt__p_Xapian__MatchDecider, 0, 0, 0},  {&_swigt__p_Xapian__ValueSetMatchDecider, _p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchSpy[] = {  {&_swigt__p_Xapian__MatchSpy, 0, 0, 0},  {&_swigt__p_Xapian__ValueCountMatchSpy, _p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MultiValueKeyMaker[] = {  {&_swigt__p_Xapian__MultiValueKeyMaker, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NumberRangeProcessor[] = {  {&_swigt__p_Xapian__NumberRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NumberValueRangeProcessor[] = {  {&_swigt__p_Xapian__NumberValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PL2PlusWeight[] = {  {&_swigt__p_Xapian__PL2PlusWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PL2Weight[] = {  {&_swigt__p_Xapian__PL2Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PositionIterator[] = {  {&_swigt__p_Xapian__PositionIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingIterator[] = {  {&_swigt__p_Xapian__PostingIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingSource[] = {  {&_swigt__p_Xapian__PostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValuePostingSource, _p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__LatLongDistancePostingSource, _p_Xapian__LatLongDistancePostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__FixedWeightPostingSource, _p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Query[] = {  {&_swigt__p_Xapian__Query, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__QueryParser[] = {  {&_swigt__p_Xapian__QueryParser, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RSet[] = {  {&_swigt__p_Xapian__RSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RangeProcessor[] = {  {&_swigt__p_Xapian__RangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__DateRangeProcessor, _p_Xapian__DateRangeProcessorTo_p_Xapian__RangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberRangeProcessor, _p_Xapian__NumberRangeProcessorTo_p_Xapian__RangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Registry[] = {  {&_swigt__p_Xapian__Registry, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__SimpleStopper[] = {  {&_swigt__p_Xapian__SimpleStopper, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stem[] = {  {&_swigt__p_Xapian__Stem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StemImplementation[] = {  {&_swigt__p_Xapian__StemImplementation, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stopper[] = {  {&_swigt__p_Xapian__Stopper, 0, 0, 0},  {&_swigt__p_Xapian__SimpleStopper, _p_Xapian__SimpleStopperTo_p_Xapian__Stopper, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StringValueRangeProcessor[] = {  {&_swigt__p_Xapian__StringValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermGenerator[] = {  {&_swigt__p_Xapian__TermGenerator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermIterator[] = {  {&_swigt__p_Xapian__TermIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TfIdfWeight[] = {  {&_swigt__p_Xapian__TfIdfWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TradWeight[] = {  {&_swigt__p_Xapian__TradWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueCountMatchSpy[] = {  {&_swigt__p_Xapian__ValueCountMatchSpy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueIterator[] = {  {&_swigt__p_Xapian__ValueIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueMapPostingSource[] = {  {&_swigt__p_Xapian__ValueMapPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValuePostingSource[] = {  {&_swigt__p_Xapian__ValuePostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__LatLongDistancePostingSource, _p_Xapian__LatLongDistancePostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueRangeProcessor[] = {  {&_swigt__p_Xapian__ValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__StringValueRangeProcessor, _p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueSetMatchDecider[] = {  {&_swigt__p_Xapian__ValueSetMatchDecider, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueWeightPostingSource[] = {  {&_swigt__p_Xapian__ValueWeightPostingSource, 0, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Weight[] = {  {&_swigt__p_Xapian__DPHWeight, _p_Xapian__DPHWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__PL2Weight, _p_Xapian__PL2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__DLHWeight, _p_Xapian__DLHWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__BB2Weight, _p_Xapian__BB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__IneB2Weight, _p_Xapian__IneB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__IfB2Weight, _p_Xapian__IfB2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__InL2Weight, _p_Xapian__InL2WeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TradWeight, _p_Xapian__TradWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TfIdfWeight, _p_Xapian__TfIdfWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__BoolWeight, _p_Xapian__BoolWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__CoordWeight, _p_Xapian__CoordWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__LMWeight, _p_Xapian__LMWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__PL2PlusWeight, _p_Xapian__PL2PlusWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__Weight, 0, 0, 0},  {&_swigt__p_Xapian__BM25PlusWeight, _p_Xapian__BM25PlusWeightTo_p_Xapian__Weight, 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_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_compaction_level[] = {  {&_swigt__p_compaction_level, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_docid_order[] = {  {&_swigt__p_docid_order, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_feature_flag[] = {  {&_swigt__p_feature_flag, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_flags[] = {  {&_swigt__p_flags, 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_std__string[] = {  {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_stem_strategy[] = {  {&_swigt__p_stem_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_stop_strategy[] = {  {&_swigt__p_stop_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_swig__ConstIterator[] = {  {&_swigt__p_swig__ConstIterator, 0, 0, 0},  {&_swigt__p_swig__Iterator, _p_swig__IteratorTo_p_swig__ConstIterator, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_swig__GC_VALUE[] = {  {&_swigt__p_swig__GC_VALUE, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_swig__Iterator[] = {  {&_swigt__p_swig__Iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_type_smoothing[] = {  {&_swigt__p_type_smoothing, 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 _swigc__p_unsigned_long[] = {  {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_Xapian__BB2Weight,
  _swigc__p_Xapian__BM25PlusWeight,
  _swigc__p_Xapian__BM25Weight,
  _swigc__p_Xapian__BoolWeight,
  _swigc__p_Xapian__Compactor,
  _swigc__p_Xapian__CoordWeight,
  _swigc__p_Xapian__DLHWeight,
  _swigc__p_Xapian__DPHWeight,
  _swigc__p_Xapian__Database,
  _swigc__p_Xapian__DateRangeProcessor,
  _swigc__p_Xapian__DateValueRangeProcessor,
  _swigc__p_Xapian__DecreasingValueWeightPostingSource,
  _swigc__p_Xapian__Document,
  _swigc__p_Xapian__ESet,
  _swigc__p_Xapian__ESetIterator,
  _swigc__p_Xapian__Enquire,
  _swigc__p_Xapian__ExpandDecider,
  _swigc__p_Xapian__ExpandDeciderAnd,
  _swigc__p_Xapian__ExpandDeciderFilterPrefix,
  _swigc__p_Xapian__ExpandDeciderFilterTerms,
  _swigc__p_Xapian__FieldProcessor,
  _swigc__p_Xapian__FixedWeightPostingSource,
  _swigc__p_Xapian__GreatCircleMetric,
  _swigc__p_Xapian__IfB2Weight,
  _swigc__p_Xapian__InL2Weight,
  _swigc__p_Xapian__IneB2Weight,
  _swigc__p_Xapian__KeyMaker,
  _swigc__p_Xapian__LMWeight,
  _swigc__p_Xapian__LatLongCoord,
  _swigc__p_Xapian__LatLongCoords,
  _swigc__p_Xapian__LatLongCoordsIterator,
  _swigc__p_Xapian__LatLongDistanceKeyMaker,
  _swigc__p_Xapian__LatLongDistancePostingSource,
  _swigc__p_Xapian__LatLongMetric,
  _swigc__p_Xapian__MSet,
  _swigc__p_Xapian__MSetIterator,
  _swigc__p_Xapian__MatchDecider,
  _swigc__p_Xapian__MatchSpy,
  _swigc__p_Xapian__MultiValueKeyMaker,
  _swigc__p_Xapian__NumberRangeProcessor,
  _swigc__p_Xapian__NumberValueRangeProcessor,
  _swigc__p_Xapian__PL2PlusWeight,
  _swigc__p_Xapian__PL2Weight,
  _swigc__p_Xapian__PositionIterator,
  _swigc__p_Xapian__PostingIterator,
  _swigc__p_Xapian__PostingSource,
  _swigc__p_Xapian__Query,
  _swigc__p_Xapian__QueryParser,
  _swigc__p_Xapian__RSet,
  _swigc__p_Xapian__RangeProcessor,
  _swigc__p_Xapian__Registry,
  _swigc__p_Xapian__SimpleStopper,
  _swigc__p_Xapian__Stem,
  _swigc__p_Xapian__StemImplementation,
  _swigc__p_Xapian__Stopper,
  _swigc__p_Xapian__StringValueRangeProcessor,
  _swigc__p_Xapian__TermGenerator,
  _swigc__p_Xapian__TermIterator,
  _swigc__p_Xapian__TfIdfWeight,
  _swigc__p_Xapian__TradWeight,
  _swigc__p_Xapian__ValueCountMatchSpy,
  _swigc__p_Xapian__ValueIterator,
  _swigc__p_Xapian__ValueMapPostingSource,
  _swigc__p_Xapian__ValuePostingSource,
  _swigc__p_Xapian__ValueRangeProcessor,
  _swigc__p_Xapian__ValueSetMatchDecider,
  _swigc__p_Xapian__ValueWeightPostingSource,
  _swigc__p_Xapian__Weight,
  _swigc__p_Xapian__WritableDatabase,
  _swigc__p_char,
  _swigc__p_compaction_level,
  _swigc__p_docid_order,
  _swigc__p_double,
  _swigc__p_feature_flag,
  _swigc__p_flags,
  _swigc__p_int,
  _swigc__p_std__string,
  _swigc__p_stem_strategy,
  _swigc__p_stop_strategy,
  _swigc__p_swig__ConstIterator,
  _swigc__p_swig__GC_VALUE,
  _swigc__p_swig__Iterator,
  _swigc__p_type_smoothing,
  _swigc__p_unsigned_int,
  _swigc__p_unsigned_long,
  _swigc__p_void,
};


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

/* -----------------------------------------------------------------------------
 * 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 statically 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 init;

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

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

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

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

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

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

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {

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

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

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

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

  if (init_run) return;
  init_run = 1;

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

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

/*

*/
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT void Init__xapian(void) {
  size_t i;
  
  SWIG_InitRuntime();
  mXapian = rb_define_module("Xapian");
  
  SWIG_InitializeModule(0);
  for (i = 0; i < swig_module.size; i++) {
    SWIG_define_class(swig_module.types[i]);
  }
  
  SWIG_RubyInitializeTrackings();
  
  SwigClassGC_VALUE.klass = rb_define_class_under(mXapian, "GC_VALUE", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_swig__GC_VALUE, (void *) &SwigClassGC_VALUE);
  rb_undef_alloc_func(SwigClassGC_VALUE.klass);
  rb_define_method(SwigClassGC_VALUE.klass, "inspect", VALUEFUNC(_wrap_GC_VALUE_inspect), -1);
  rb_define_method(SwigClassGC_VALUE.klass, "to_s", VALUEFUNC(_wrap_GC_VALUE_to_s), -1);
  SwigClassGC_VALUE.mark = 0;
  SwigClassGC_VALUE.trackObjects = 0;
  
  swig::SwigGCReferences::initialize();
  
  
  SwigClassConstIterator.klass = rb_define_class_under(mXapian, "ConstIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_swig__ConstIterator, (void *) &SwigClassConstIterator);
  rb_undef_alloc_func(SwigClassConstIterator.klass);
  rb_define_method(SwigClassConstIterator.klass, "value", VALUEFUNC(_wrap_ConstIterator_value), -1);
  rb_define_method(SwigClassConstIterator.klass, "dup", VALUEFUNC(_wrap_ConstIterator_dup), -1);
  rb_define_method(SwigClassConstIterator.klass, "inspect", VALUEFUNC(_wrap_ConstIterator_inspect), -1);
  rb_define_method(SwigClassConstIterator.klass, "to_s", VALUEFUNC(_wrap_ConstIterator_to_s), -1);
  rb_define_method(SwigClassConstIterator.klass, "next", VALUEFUNC(_wrap_ConstIterator_next), -1);
  rb_define_method(SwigClassConstIterator.klass, "previous", VALUEFUNC(_wrap_ConstIterator_previous), -1);
  rb_define_method(SwigClassConstIterator.klass, "==", VALUEFUNC(_wrap_ConstIterator___eq__), -1);
  rb_define_method(SwigClassConstIterator.klass, "+", VALUEFUNC(_wrap_ConstIterator___add__), -1);
  rb_define_method(SwigClassConstIterator.klass, "-", VALUEFUNC(_wrap_ConstIterator___sub__), -1);
  SwigClassConstIterator.mark = 0;
  SwigClassConstIterator.destroy = (void (*)(void *)) free_swig_ConstIterator;
  SwigClassConstIterator.trackObjects = 0;
  
  SwigClassIterator.klass = rb_define_class_under(mXapian, "Iterator", ((swig_class *) SWIGTYPE_p_swig__ConstIterator->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_swig__Iterator, (void *) &SwigClassIterator);
  rb_undef_alloc_func(SwigClassIterator.klass);
  rb_define_method(SwigClassIterator.klass, "value=", VALUEFUNC(_wrap_Iterator_valuee___), -1);
  rb_define_method(SwigClassIterator.klass, "dup", VALUEFUNC(_wrap_Iterator_dup), -1);
  rb_define_method(SwigClassIterator.klass, "next", VALUEFUNC(_wrap_Iterator_next), -1);
  rb_define_method(SwigClassIterator.klass, "previous", VALUEFUNC(_wrap_Iterator_previous), -1);
  rb_define_method(SwigClassIterator.klass, "inspect", VALUEFUNC(_wrap_Iterator_inspect), -1);
  rb_define_method(SwigClassIterator.klass, "to_s", VALUEFUNC(_wrap_Iterator_to_s), -1);
  rb_define_method(SwigClassIterator.klass, "==", VALUEFUNC(_wrap_Iterator___eq__), -1);
  rb_define_method(SwigClassIterator.klass, "+", VALUEFUNC(_wrap_Iterator___add__), -1);
  rb_define_method(SwigClassIterator.klass, "-", VALUEFUNC(_wrap_Iterator___sub__), -1);
  SwigClassIterator.mark = 0;
  SwigClassIterator.destroy = (void (*)(void *)) free_swig_Iterator;
  SwigClassIterator.trackObjects = 0;
  rb_define_module_function(mXapian, "version_string", VALUEFUNC(_wrap_version_string), -1);
  rb_define_module_function(mXapian, "major_version", VALUEFUNC(_wrap_major_version), -1);
  rb_define_module_function(mXapian, "minor_version", VALUEFUNC(_wrap_minor_version), -1);
  rb_define_module_function(mXapian, "revision", VALUEFUNC(_wrap_revision), -1);
  rb_define_const(mXapian, "BAD_VALUENO", SWIG_From_unsigned_SS_int(static_cast< unsigned int >(Xapian::BAD_VALUENO)));
  rb_define_const(mXapian, "DB_CREATE", SWIG_From_int(static_cast< int >(Xapian::DB_CREATE)));
  rb_define_const(mXapian, "DB_CREATE_OR_OPEN", SWIG_From_int(static_cast< int >(Xapian::DB_CREATE_OR_OPEN)));
  rb_define_const(mXapian, "DB_CREATE_OR_OVERWRITE", SWIG_From_int(static_cast< int >(Xapian::DB_CREATE_OR_OVERWRITE)));
  rb_define_const(mXapian, "DB_OPEN", SWIG_From_int(static_cast< int >(Xapian::DB_OPEN)));
  rb_define_const(mXapian, "DB_NO_SYNC", SWIG_From_int(static_cast< int >(Xapian::DB_NO_SYNC)));
  rb_define_const(mXapian, "DB_FULL_SYNC", SWIG_From_int(static_cast< int >(Xapian::DB_FULL_SYNC)));
  rb_define_const(mXapian, "DB_DANGEROUS", SWIG_From_int(static_cast< int >(Xapian::DB_DANGEROUS)));
  rb_define_const(mXapian, "DB_NO_TERMLIST", SWIG_From_int(static_cast< int >(Xapian::DB_NO_TERMLIST)));
  rb_define_const(mXapian, "DB_BACKEND_CHERT", SWIG_From_int(static_cast< int >(Xapian::DB_BACKEND_CHERT)));
  rb_define_const(mXapian, "DB_BACKEND_GLASS", SWIG_From_int(static_cast< int >(Xapian::DB_BACKEND_GLASS)));
  rb_define_const(mXapian, "DB_BACKEND_INMEMORY", SWIG_From_int(static_cast< int >(Xapian::DB_BACKEND_INMEMORY)));
  rb_define_const(mXapian, "DB_BACKEND_STUB", SWIG_From_int(static_cast< int >(Xapian::DB_BACKEND_STUB)));
  rb_define_const(mXapian, "DB_RETRY_LOCK", SWIG_From_int(static_cast< int >(Xapian::DB_RETRY_LOCK)));
  rb_define_const(mXapian, "DBCHECK_SHORT_TREE", SWIG_From_int(static_cast< int >(Xapian::DBCHECK_SHORT_TREE)));
  rb_define_const(mXapian, "DBCHECK_FULL_TREE", SWIG_From_int(static_cast< int >(Xapian::DBCHECK_FULL_TREE)));
  rb_define_const(mXapian, "DBCHECK_SHOW_FREELIST", SWIG_From_int(static_cast< int >(Xapian::DBCHECK_SHOW_FREELIST)));
  rb_define_const(mXapian, "DBCHECK_SHOW_STATS", SWIG_From_int(static_cast< int >(Xapian::DBCHECK_SHOW_STATS)));
  rb_define_const(mXapian, "DBCHECK_FIX", SWIG_From_int(static_cast< int >(Xapian::DBCHECK_FIX)));
  rb_define_const(mXapian, "DBCOMPACT_MULTIPASS", SWIG_From_int(static_cast< int >(Xapian::DBCOMPACT_MULTIPASS)));
  rb_define_const(mXapian, "DBCOMPACT_NO_RENUMBER", SWIG_From_int(static_cast< int >(Xapian::DBCOMPACT_NO_RENUMBER)));
  rb_define_const(mXapian, "DBCOMPACT_SINGLE_FILE", SWIG_From_int(static_cast< int >(Xapian::DBCOMPACT_SINGLE_FILE)));
  rb_define_const(mXapian, "DOC_ASSUME_VALID", SWIG_From_int(static_cast< int >(Xapian::DOC_ASSUME_VALID)));
  
  SwigClassPositionIterator.klass = rb_define_class_under(mXapian, "PositionIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__PositionIterator, (void *) &SwigClassPositionIterator);
  rb_define_alloc_func(SwigClassPositionIterator.klass, _wrap_PositionIterator_allocate);
  rb_define_method(SwigClassPositionIterator.klass, "initialize", VALUEFUNC(_wrap_new_PositionIterator), -1);
  rb_define_method(SwigClassPositionIterator.klass, "skip_to", VALUEFUNC(_wrap_PositionIterator_skip_to), -1);
  rb_define_method(SwigClassPositionIterator.klass, "description", VALUEFUNC(_wrap_PositionIterator_description), -1);
  rb_define_method(SwigClassPositionIterator.klass, "equals", VALUEFUNC(_wrap_PositionIterator_equals), -1);
  rb_define_method(SwigClassPositionIterator.klass, "termpos", VALUEFUNC(_wrap_PositionIterator_termpos), -1);
  rb_define_method(SwigClassPositionIterator.klass, "next", VALUEFUNC(_wrap_PositionIterator_next), -1);
  SwigClassPositionIterator.mark = 0;
  SwigClassPositionIterator.destroy = (void (*)(void *)) free_Xapian_PositionIterator;
  SwigClassPositionIterator.trackObjects = 0;
  
  SwigClassPostingIterator.klass = rb_define_class_under(mXapian, "PostingIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__PostingIterator, (void *) &SwigClassPostingIterator);
  rb_define_alloc_func(SwigClassPostingIterator.klass, _wrap_PostingIterator_allocate);
  rb_define_method(SwigClassPostingIterator.klass, "initialize", VALUEFUNC(_wrap_new_PostingIterator), -1);
  rb_define_method(SwigClassPostingIterator.klass, "wdf", VALUEFUNC(_wrap_PostingIterator_wdf), -1);
  rb_define_method(SwigClassPostingIterator.klass, "doclength", VALUEFUNC(_wrap_PostingIterator_doclength), -1);
  rb_define_method(SwigClassPostingIterator.klass, "get_unique_terms", VALUEFUNC(_wrap_PostingIterator_get_unique_terms), -1);
  rb_define_method(SwigClassPostingIterator.klass, "_dangerous_positionlist_begin", VALUEFUNC(_wrap_PostingIterator__dangerous_positionlist_begin), -1);
  rb_define_method(SwigClassPostingIterator.klass, "_dangerous_positionlist_end", VALUEFUNC(_wrap_PostingIterator__dangerous_positionlist_end), -1);
  rb_define_method(SwigClassPostingIterator.klass, "skip_to", VALUEFUNC(_wrap_PostingIterator_skip_to), -1);
  rb_define_method(SwigClassPostingIterator.klass, "description", VALUEFUNC(_wrap_PostingIterator_description), -1);
  rb_define_method(SwigClassPostingIterator.klass, "equals", VALUEFUNC(_wrap_PostingIterator_equals), -1);
  rb_define_method(SwigClassPostingIterator.klass, "docid", VALUEFUNC(_wrap_PostingIterator_docid), -1);
  rb_define_method(SwigClassPostingIterator.klass, "next", VALUEFUNC(_wrap_PostingIterator_next), -1);
  SwigClassPostingIterator.mark = 0;
  SwigClassPostingIterator.destroy = (void (*)(void *)) free_Xapian_PostingIterator;
  SwigClassPostingIterator.trackObjects = 0;
  
  SwigClassTermIterator.klass = rb_define_class_under(mXapian, "TermIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__TermIterator, (void *) &SwigClassTermIterator);
  rb_define_alloc_func(SwigClassTermIterator.klass, _wrap_TermIterator_allocate);
  rb_define_method(SwigClassTermIterator.klass, "initialize", VALUEFUNC(_wrap_new_TermIterator), -1);
  rb_define_method(SwigClassTermIterator.klass, "wdf", VALUEFUNC(_wrap_TermIterator_wdf), -1);
  rb_define_method(SwigClassTermIterator.klass, "termfreq", VALUEFUNC(_wrap_TermIterator_termfreq), -1);
  rb_define_method(SwigClassTermIterator.klass, "positionlist_count", VALUEFUNC(_wrap_TermIterator_positionlist_count), -1);
  rb_define_method(SwigClassTermIterator.klass, "_dangerous_positionlist_begin", VALUEFUNC(_wrap_TermIterator__dangerous_positionlist_begin), -1);
  rb_define_method(SwigClassTermIterator.klass, "_dangerous_positionlist_end", VALUEFUNC(_wrap_TermIterator__dangerous_positionlist_end), -1);
  rb_define_method(SwigClassTermIterator.klass, "skip_to", VALUEFUNC(_wrap_TermIterator_skip_to), -1);
  rb_define_method(SwigClassTermIterator.klass, "description", VALUEFUNC(_wrap_TermIterator_description), -1);
  rb_define_method(SwigClassTermIterator.klass, "equals", VALUEFUNC(_wrap_TermIterator_equals), -1);
  rb_define_method(SwigClassTermIterator.klass, "term", VALUEFUNC(_wrap_TermIterator_term), -1);
  rb_define_method(SwigClassTermIterator.klass, "next", VALUEFUNC(_wrap_TermIterator_next), -1);
  SwigClassTermIterator.mark = 0;
  SwigClassTermIterator.destroy = (void (*)(void *)) free_Xapian_TermIterator;
  SwigClassTermIterator.trackObjects = 0;
  
  SwigClassValueIterator.klass = rb_define_class_under(mXapian, "ValueIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueIterator, (void *) &SwigClassValueIterator);
  rb_define_alloc_func(SwigClassValueIterator.klass, _wrap_ValueIterator_allocate);
  rb_define_method(SwigClassValueIterator.klass, "initialize", VALUEFUNC(_wrap_new_ValueIterator), -1);
  rb_define_method(SwigClassValueIterator.klass, "docid", VALUEFUNC(_wrap_ValueIterator_docid), -1);
  rb_define_method(SwigClassValueIterator.klass, "valueno", VALUEFUNC(_wrap_ValueIterator_valueno), -1);
  rb_define_method(SwigClassValueIterator.klass, "skip_to", VALUEFUNC(_wrap_ValueIterator_skip_to), -1);
  rb_define_method(SwigClassValueIterator.klass, "check", VALUEFUNC(_wrap_ValueIterator_check), -1);
  rb_define_method(SwigClassValueIterator.klass, "description", VALUEFUNC(_wrap_ValueIterator_description), -1);
  rb_define_method(SwigClassValueIterator.klass, "equals", VALUEFUNC(_wrap_ValueIterator_equals), -1);
  rb_define_method(SwigClassValueIterator.klass, "value", VALUEFUNC(_wrap_ValueIterator_value), -1);
  rb_define_method(SwigClassValueIterator.klass, "next", VALUEFUNC(_wrap_ValueIterator_next), -1);
  SwigClassValueIterator.mark = 0;
  SwigClassValueIterator.destroy = (void (*)(void *)) free_Xapian_ValueIterator;
  SwigClassValueIterator.trackObjects = 0;
  
  SwigClassDocument.klass = rb_define_class_under(mXapian, "Document", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Document, (void *) &SwigClassDocument);
  rb_define_alloc_func(SwigClassDocument.klass, _wrap_Document_allocate);
  rb_define_method(SwigClassDocument.klass, "initialize", VALUEFUNC(_wrap_new_Document), -1);
  rb_define_method(SwigClassDocument.klass, "value", VALUEFUNC(_wrap_Document_value), -1);
  rb_define_method(SwigClassDocument.klass, "add_value", VALUEFUNC(_wrap_Document_add_value), -1);
  rb_define_method(SwigClassDocument.klass, "remove_value", VALUEFUNC(_wrap_Document_remove_value), -1);
  rb_define_method(SwigClassDocument.klass, "clear_values", VALUEFUNC(_wrap_Document_clear_values), -1);
  rb_define_method(SwigClassDocument.klass, "data", VALUEFUNC(_wrap_Document_data), -1);
  rb_define_method(SwigClassDocument.klass, "data=", VALUEFUNC(_wrap_Document_datae___), -1);
  rb_define_method(SwigClassDocument.klass, "add_posting", VALUEFUNC(_wrap_Document_add_posting), -1);
  rb_define_method(SwigClassDocument.klass, "add_term", VALUEFUNC(_wrap_Document_add_term), -1);
  rb_define_method(SwigClassDocument.klass, "add_boolean_term", VALUEFUNC(_wrap_Document_add_boolean_term), -1);
  rb_define_method(SwigClassDocument.klass, "remove_posting", VALUEFUNC(_wrap_Document_remove_posting), -1);
  rb_define_method(SwigClassDocument.klass, "remove_postings", VALUEFUNC(_wrap_Document_remove_postings), -1);
  rb_define_method(SwigClassDocument.klass, "remove_term", VALUEFUNC(_wrap_Document_remove_term), -1);
  rb_define_method(SwigClassDocument.klass, "clear_terms", VALUEFUNC(_wrap_Document_clear_terms), -1);
  rb_define_method(SwigClassDocument.klass, "termlist_count", VALUEFUNC(_wrap_Document_termlist_count), -1);
  rb_define_method(SwigClassDocument.klass, "_dangerous_termlist_begin", VALUEFUNC(_wrap_Document__dangerous_termlist_begin), -1);
  rb_define_method(SwigClassDocument.klass, "_dangerous_termlist_end", VALUEFUNC(_wrap_Document__dangerous_termlist_end), -1);
  rb_define_method(SwigClassDocument.klass, "values_count", VALUEFUNC(_wrap_Document_values_count), -1);
  rb_define_method(SwigClassDocument.klass, "_dangerous_values_begin", VALUEFUNC(_wrap_Document__dangerous_values_begin), -1);
  rb_define_method(SwigClassDocument.klass, "_dangerous_values_end", VALUEFUNC(_wrap_Document__dangerous_values_end), -1);
  rb_define_method(SwigClassDocument.klass, "docid", VALUEFUNC(_wrap_Document_docid), -1);
  rb_define_method(SwigClassDocument.klass, "serialise", VALUEFUNC(_wrap_Document_serialise), -1);
  rb_define_singleton_method(SwigClassDocument.klass, "unserialise", VALUEFUNC(_wrap_Document_unserialise), -1);
  rb_define_method(SwigClassDocument.klass, "description", VALUEFUNC(_wrap_Document_description), -1);
  SwigClassDocument.mark = 0;
  SwigClassDocument.destroy = (void (*)(void *)) free_Xapian_Document;
  SwigClassDocument.trackObjects = 0;
  
  SwigClassRegistry.klass = rb_define_class_under(mXapian, "Registry", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Registry, (void *) &SwigClassRegistry);
  rb_define_alloc_func(SwigClassRegistry.klass, _wrap_Registry_allocate);
  rb_define_method(SwigClassRegistry.klass, "initialize", VALUEFUNC(_wrap_new_Registry), -1);
  rb_define_method(SwigClassRegistry.klass, "register_weighting_scheme", VALUEFUNC(_wrap_Registry_register_weighting_scheme), -1);
  rb_define_method(SwigClassRegistry.klass, "get_weighting_scheme", VALUEFUNC(_wrap_Registry_get_weighting_scheme), -1);
  rb_define_method(SwigClassRegistry.klass, "register_posting_source", VALUEFUNC(_wrap_Registry_register_posting_source), -1);
  rb_define_method(SwigClassRegistry.klass, "get_posting_source", VALUEFUNC(_wrap_Registry_get_posting_source), -1);
  rb_define_method(SwigClassRegistry.klass, "register_match_spy", VALUEFUNC(_wrap_Registry_register_match_spy), -1);
  rb_define_method(SwigClassRegistry.klass, "get_match_spy", VALUEFUNC(_wrap_Registry_get_match_spy), -1);
  rb_define_method(SwigClassRegistry.klass, "register_lat_long_metric", VALUEFUNC(_wrap_Registry_register_lat_long_metric), -1);
  rb_define_method(SwigClassRegistry.klass, "get_lat_long_metric", VALUEFUNC(_wrap_Registry_get_lat_long_metric), -1);
  SwigClassRegistry.mark = 0;
  SwigClassRegistry.destroy = (void (*)(void *)) free_Xapian_Registry;
  SwigClassRegistry.trackObjects = 0;
  
  SwigClassQuery.klass = rb_define_class_under(mXapian, "Query", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Query, (void *) &SwigClassQuery);
  rb_define_alloc_func(SwigClassQuery.klass, _wrap_Query_allocate);
  rb_define_method(SwigClassQuery.klass, "initialize", VALUEFUNC(_wrap_new_Query), -1);
  rb_define_const(SwigClassQuery.klass, "OP_AND", SWIG_From_int(static_cast< int >(Xapian::Query::OP_AND)));
  rb_define_const(SwigClassQuery.klass, "OP_OR", SWIG_From_int(static_cast< int >(Xapian::Query::OP_OR)));
  rb_define_const(SwigClassQuery.klass, "OP_AND_NOT", SWIG_From_int(static_cast< int >(Xapian::Query::OP_AND_NOT)));
  rb_define_const(SwigClassQuery.klass, "OP_XOR", SWIG_From_int(static_cast< int >(Xapian::Query::OP_XOR)));
  rb_define_const(SwigClassQuery.klass, "OP_AND_MAYBE", SWIG_From_int(static_cast< int >(Xapian::Query::OP_AND_MAYBE)));
  rb_define_const(SwigClassQuery.klass, "OP_FILTER", SWIG_From_int(static_cast< int >(Xapian::Query::OP_FILTER)));
  rb_define_const(SwigClassQuery.klass, "OP_NEAR", SWIG_From_int(static_cast< int >(Xapian::Query::OP_NEAR)));
  rb_define_const(SwigClassQuery.klass, "OP_PHRASE", SWIG_From_int(static_cast< int >(Xapian::Query::OP_PHRASE)));
  rb_define_const(SwigClassQuery.klass, "OP_VALUE_RANGE", SWIG_From_int(static_cast< int >(Xapian::Query::OP_VALUE_RANGE)));
  rb_define_const(SwigClassQuery.klass, "OP_SCALE_WEIGHT", SWIG_From_int(static_cast< int >(Xapian::Query::OP_SCALE_WEIGHT)));
  rb_define_const(SwigClassQuery.klass, "OP_ELITE_SET", SWIG_From_int(static_cast< int >(Xapian::Query::OP_ELITE_SET)));
  rb_define_const(SwigClassQuery.klass, "OP_VALUE_GE", SWIG_From_int(static_cast< int >(Xapian::Query::OP_VALUE_GE)));
  rb_define_const(SwigClassQuery.klass, "OP_VALUE_LE", SWIG_From_int(static_cast< int >(Xapian::Query::OP_VALUE_LE)));
  rb_define_const(SwigClassQuery.klass, "OP_SYNONYM", SWIG_From_int(static_cast< int >(Xapian::Query::OP_SYNONYM)));
  rb_define_const(SwigClassQuery.klass, "OP_MAX", SWIG_From_int(static_cast< int >(Xapian::Query::OP_MAX)));
  rb_define_const(SwigClassQuery.klass, "OP_WILDCARD", SWIG_From_int(static_cast< int >(Xapian::Query::OP_WILDCARD)));
  rb_define_const(SwigClassQuery.klass, "OP_INVALID", SWIG_From_int(static_cast< int >(Xapian::Query::OP_INVALID)));
  rb_define_const(SwigClassQuery.klass, "WILDCARD_LIMIT_ERROR", SWIG_From_int(static_cast< int >(Xapian::Query::WILDCARD_LIMIT_ERROR)));
  rb_define_const(SwigClassQuery.klass, "WILDCARD_LIMIT_FIRST", SWIG_From_int(static_cast< int >(Xapian::Query::WILDCARD_LIMIT_FIRST)));
  rb_define_const(SwigClassQuery.klass, "WILDCARD_LIMIT_MOST_FREQUENT", SWIG_From_int(static_cast< int >(Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT)));
  rb_define_method(SwigClassQuery.klass, "_dangerous_terms_begin", VALUEFUNC(_wrap_Query__dangerous_terms_begin), -1);
  rb_define_method(SwigClassQuery.klass, "_dangerous_terms_end", VALUEFUNC(_wrap_Query__dangerous_terms_end), -1);
  rb_define_method(SwigClassQuery.klass, "_dangerous_unique_terms_begin", VALUEFUNC(_wrap_Query__dangerous_unique_terms_begin), -1);
  rb_define_method(SwigClassQuery.klass, "_dangerous_unique_terms_end", VALUEFUNC(_wrap_Query__dangerous_unique_terms_end), -1);
  rb_define_method(SwigClassQuery.klass, "length", VALUEFUNC(_wrap_Query_length), -1);
  rb_define_method(SwigClassQuery.klass, "empty?", VALUEFUNC(_wrap_Query_emptyq___), -1);
  rb_define_method(SwigClassQuery.klass, "serialise", VALUEFUNC(_wrap_Query_serialise), -1);
  rb_define_singleton_method(SwigClassQuery.klass, "unserialise", VALUEFUNC(_wrap_Query_unserialise), -1);
  rb_define_method(SwigClassQuery.klass, "type", VALUEFUNC(_wrap_Query_type), -1);
  rb_define_method(SwigClassQuery.klass, "get_num_subqueries", VALUEFUNC(_wrap_Query_get_num_subqueries), -1);
  rb_define_method(SwigClassQuery.klass, "get_subquery", VALUEFUNC(_wrap_Query_get_subquery), -1);
  rb_define_method(SwigClassQuery.klass, "description", VALUEFUNC(_wrap_Query_description), -1);
  SwigClassQuery.mark = 0;
  SwigClassQuery.destroy = (void (*)(void *)) free_Xapian_Query;
  SwigClassQuery.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_StemImplementation", VALUEFUNC(_wrap_disown_StemImplementation), -1);
  
  SwigClassStemImplementation.klass = rb_define_class_under(mXapian, "StemImplementation", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__StemImplementation, (void *) &SwigClassStemImplementation);
  rb_define_alloc_func(SwigClassStemImplementation.klass, _wrap_StemImplementation_allocate);
  rb_define_method(SwigClassStemImplementation.klass, "initialize", VALUEFUNC(_wrap_new_StemImplementation), -1);
  rb_define_method(SwigClassStemImplementation.klass, "call", VALUEFUNC(_wrap_StemImplementation___call__), -1);
  rb_define_method(SwigClassStemImplementation.klass, "description", VALUEFUNC(_wrap_StemImplementation_description), -1);
  SwigClassStemImplementation.mark = 0;
  SwigClassStemImplementation.destroy = (void (*)(void *)) free_Xapian_StemImplementation;
  SwigClassStemImplementation.trackObjects = 0;
  
  SwigClassStem.klass = rb_define_class_under(mXapian, "Stem", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stem, (void *) &SwigClassStem);
  rb_define_alloc_func(SwigClassStem.klass, _wrap_Stem_allocate);
  rb_define_method(SwigClassStem.klass, "initialize", VALUEFUNC(_wrap_new_Stem), -1);
  rb_define_method(SwigClassStem.klass, "call", VALUEFUNC(_wrap_Stem___call__), -1);
  rb_define_method(SwigClassStem.klass, "is_none", VALUEFUNC(_wrap_Stem_is_none), -1);
  rb_define_method(SwigClassStem.klass, "description", VALUEFUNC(_wrap_Stem_description), -1);
  rb_define_singleton_method(SwigClassStem.klass, "available_languages", VALUEFUNC(_wrap_Stem_available_languages), -1);
  SwigClassStem.mark = 0;
  SwigClassStem.destroy = (void (*)(void *)) free_Xapian_Stem;
  SwigClassStem.trackObjects = 0;
  
  SwigClassTermGenerator.klass = rb_define_class_under(mXapian, "TermGenerator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__TermGenerator, (void *) &SwigClassTermGenerator);
  rb_define_alloc_func(SwigClassTermGenerator.klass, _wrap_TermGenerator_allocate);
  rb_define_method(SwigClassTermGenerator.klass, "initialize", VALUEFUNC(_wrap_new_TermGenerator), -1);
  rb_define_method(SwigClassTermGenerator.klass, "stemmer=", VALUEFUNC(_wrap_TermGenerator_stemmere___), -1);
  rb_define_method(SwigClassTermGenerator.klass, "stopper=", VALUEFUNC(_wrap_TermGenerator_stoppere___), -1);
  rb_define_method(SwigClassTermGenerator.klass, "document=", VALUEFUNC(_wrap_TermGenerator_documente___), -1);
  rb_define_method(SwigClassTermGenerator.klass, "document", VALUEFUNC(_wrap_TermGenerator_document), -1);
  rb_define_method(SwigClassTermGenerator.klass, "database=", VALUEFUNC(_wrap_TermGenerator_databasee___), -1);
  rb_define_const(SwigClassTermGenerator.klass, "FLAG_SPELLING", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::FLAG_SPELLING)));
  rb_define_const(SwigClassTermGenerator.klass, "FLAG_CJK_NGRAM", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::FLAG_CJK_NGRAM)));
  rb_define_const(SwigClassTermGenerator.klass, "STEM_NONE", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STEM_NONE)));
  rb_define_const(SwigClassTermGenerator.klass, "STEM_SOME", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STEM_SOME)));
  rb_define_const(SwigClassTermGenerator.klass, "STEM_ALL", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STEM_ALL)));
  rb_define_const(SwigClassTermGenerator.klass, "STEM_ALL_Z", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STEM_ALL_Z)));
  rb_define_const(SwigClassTermGenerator.klass, "STEM_SOME_FULL_POS", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STEM_SOME_FULL_POS)));
  rb_define_const(SwigClassTermGenerator.klass, "STOP_NONE", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STOP_NONE)));
  rb_define_const(SwigClassTermGenerator.klass, "STOP_ALL", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STOP_ALL)));
  rb_define_const(SwigClassTermGenerator.klass, "STOP_STEMMED", SWIG_From_int(static_cast< int >(Xapian::TermGenerator::STOP_STEMMED)));
  rb_define_method(SwigClassTermGenerator.klass, "set_flags", VALUEFUNC(_wrap_TermGenerator_set_flags), -1);
  rb_define_method(SwigClassTermGenerator.klass, "stemming_strategy=", VALUEFUNC(_wrap_TermGenerator_stemming_strategye___), -1);
  rb_define_method(SwigClassTermGenerator.klass, "set_stopper_strategy", VALUEFUNC(_wrap_TermGenerator_set_stopper_strategy), -1);
  rb_define_method(SwigClassTermGenerator.klass, "set_max_word_length", VALUEFUNC(_wrap_TermGenerator_set_max_word_length), -1);
  rb_define_method(SwigClassTermGenerator.klass, "index_text", VALUEFUNC(_wrap_TermGenerator_index_text), -1);
  rb_define_method(SwigClassTermGenerator.klass, "index_text_without_positions", VALUEFUNC(_wrap_TermGenerator_index_text_without_positions), -1);
  rb_define_method(SwigClassTermGenerator.klass, "increase_termpos", VALUEFUNC(_wrap_TermGenerator_increase_termpos), -1);
  rb_define_method(SwigClassTermGenerator.klass, "termpos", VALUEFUNC(_wrap_TermGenerator_termpos), -1);
  rb_define_method(SwigClassTermGenerator.klass, "set_termpos", VALUEFUNC(_wrap_TermGenerator_set_termpos), -1);
  rb_define_method(SwigClassTermGenerator.klass, "description", VALUEFUNC(_wrap_TermGenerator_description), -1);
  SwigClassTermGenerator.mark = 0;
  SwigClassTermGenerator.destroy = (void (*)(void *)) free_Xapian_TermGenerator;
  SwigClassTermGenerator.trackObjects = 0;
  
  SwigClassMSet.klass = rb_define_class_under(mXapian, "MSet", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSet, (void *) &SwigClassMSet);
  rb_define_alloc_func(SwigClassMSet.klass, _wrap_MSet_allocate);
  rb_define_method(SwigClassMSet.klass, "initialize", VALUEFUNC(_wrap_new_MSet), -1);
  rb_define_method(SwigClassMSet.klass, "convert_to_percent", VALUEFUNC(_wrap_MSet_convert_to_percent), -1);
  rb_define_method(SwigClassMSet.klass, "termfreq", VALUEFUNC(_wrap_MSet_termfreq), -1);
  rb_define_method(SwigClassMSet.klass, "termweight", VALUEFUNC(_wrap_MSet_termweight), -1);
  rb_define_method(SwigClassMSet.klass, "firstitem", VALUEFUNC(_wrap_MSet_firstitem), -1);
  rb_define_method(SwigClassMSet.klass, "matches_lower_bound", VALUEFUNC(_wrap_MSet_matches_lower_bound), -1);
  rb_define_method(SwigClassMSet.klass, "matches_estimated", VALUEFUNC(_wrap_MSet_matches_estimated), -1);
  rb_define_method(SwigClassMSet.klass, "matches_upper_bound", VALUEFUNC(_wrap_MSet_matches_upper_bound), -1);
  rb_define_method(SwigClassMSet.klass, "get_uncollapsed_matches_lower_bound", VALUEFUNC(_wrap_MSet_get_uncollapsed_matches_lower_bound), -1);
  rb_define_method(SwigClassMSet.klass, "get_uncollapsed_matches_estimated", VALUEFUNC(_wrap_MSet_get_uncollapsed_matches_estimated), -1);
  rb_define_method(SwigClassMSet.klass, "get_uncollapsed_matches_upper_bound", VALUEFUNC(_wrap_MSet_get_uncollapsed_matches_upper_bound), -1);
  rb_define_method(SwigClassMSet.klass, "max_attained", VALUEFUNC(_wrap_MSet_max_attained), -1);
  rb_define_method(SwigClassMSet.klass, "max_possible", VALUEFUNC(_wrap_MSet_max_possible), -1);
  rb_define_const(SwigClassMSet.klass, "SNIPPET_BACKGROUND_MODEL", SWIG_From_int(static_cast< int >(Xapian::MSet::SNIPPET_BACKGROUND_MODEL)));
  rb_define_const(SwigClassMSet.klass, "SNIPPET_EXHAUSTIVE", SWIG_From_int(static_cast< int >(Xapian::MSet::SNIPPET_EXHAUSTIVE)));
  rb_define_const(SwigClassMSet.klass, "SNIPPET_EMPTY_WITHOUT_MATCH", SWIG_From_int(static_cast< int >(Xapian::MSet::SNIPPET_EMPTY_WITHOUT_MATCH)));
  rb_define_const(SwigClassMSet.klass, "SNIPPET_CJK_NGRAM", SWIG_From_int(static_cast< int >(Xapian::MSet::SNIPPET_CJK_NGRAM)));
  rb_define_method(SwigClassMSet.klass, "snippet", VALUEFUNC(_wrap_MSet_snippet), -1);
  rb_define_method(SwigClassMSet.klass, "fetch", VALUEFUNC(_wrap_MSet_fetch), -1);
  rb_define_method(SwigClassMSet.klass, "size", VALUEFUNC(_wrap_MSet_size), -1);
  rb_define_method(SwigClassMSet.klass, "empty?", VALUEFUNC(_wrap_MSet_emptyq___), -1);
  rb_define_method(SwigClassMSet.klass, "_begin", VALUEFUNC(_wrap_MSet__begin), -1);
  rb_define_method(SwigClassMSet.klass, "_end", VALUEFUNC(_wrap_MSet__end), -1);
  rb_define_method(SwigClassMSet.klass, "_back", VALUEFUNC(_wrap_MSet__back), -1);
  rb_define_method(SwigClassMSet.klass, "description", VALUEFUNC(_wrap_MSet_description), -1);
  rb_define_method(SwigClassMSet.klass, "docid", VALUEFUNC(_wrap_MSet_docid), -1);
  rb_define_method(SwigClassMSet.klass, "document", VALUEFUNC(_wrap_MSet_document), -1);
  rb_define_method(SwigClassMSet.klass, "hit", VALUEFUNC(_wrap_MSet_hit), -1);
  rb_define_method(SwigClassMSet.klass, "document_percentage", VALUEFUNC(_wrap_MSet_document_percentage), -1);
  SwigClassMSet.mark = 0;
  SwigClassMSet.destroy = (void (*)(void *)) free_Xapian_MSet;
  SwigClassMSet.trackObjects = 0;
  
  SwigClassMSetIterator.klass = rb_define_class_under(mXapian, "MSetIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSetIterator, (void *) &SwigClassMSetIterator);
  rb_define_alloc_func(SwigClassMSetIterator.klass, _wrap_MSetIterator_allocate);
  rb_define_method(SwigClassMSetIterator.klass, "initialize", VALUEFUNC(_wrap_new_MSetIterator), -1);
  rb_define_method(SwigClassMSetIterator.klass, "mset=", VALUEFUNC(_wrap_MSetIterator_mset_set), -1);
  rb_define_method(SwigClassMSetIterator.klass, "mset", VALUEFUNC(_wrap_MSetIterator_mset_get), -1);
  rb_define_method(SwigClassMSetIterator.klass, "off_from_end=", VALUEFUNC(_wrap_MSetIterator_off_from_end_set), -1);
  rb_define_method(SwigClassMSetIterator.klass, "off_from_end", VALUEFUNC(_wrap_MSetIterator_off_from_end_get), -1);
  rb_define_method(SwigClassMSetIterator.klass, "rank", VALUEFUNC(_wrap_MSetIterator_rank), -1);
  rb_define_method(SwigClassMSetIterator.klass, "document", VALUEFUNC(_wrap_MSetIterator_document), -1);
  rb_define_method(SwigClassMSetIterator.klass, "weight", VALUEFUNC(_wrap_MSetIterator_weight), -1);
  rb_define_method(SwigClassMSetIterator.klass, "get_collapse_key", VALUEFUNC(_wrap_MSetIterator_get_collapse_key), -1);
  rb_define_method(SwigClassMSetIterator.klass, "collapse_count", VALUEFUNC(_wrap_MSetIterator_collapse_count), -1);
  rb_define_method(SwigClassMSetIterator.klass, "get_sort_key", VALUEFUNC(_wrap_MSetIterator_get_sort_key), -1);
  rb_define_method(SwigClassMSetIterator.klass, "percent", VALUEFUNC(_wrap_MSetIterator_percent), -1);
  rb_define_method(SwigClassMSetIterator.klass, "description", VALUEFUNC(_wrap_MSetIterator_description), -1);
  rb_define_method(SwigClassMSetIterator.klass, "equals", VALUEFUNC(_wrap_MSetIterator_equals), -1);
  rb_define_method(SwigClassMSetIterator.klass, "docid", VALUEFUNC(_wrap_MSetIterator_docid), -1);
  rb_define_method(SwigClassMSetIterator.klass, "next", VALUEFUNC(_wrap_MSetIterator_next), -1);
  rb_define_method(SwigClassMSetIterator.klass, "prev", VALUEFUNC(_wrap_MSetIterator_prev), -1);
  SwigClassMSetIterator.mark = 0;
  SwigClassMSetIterator.destroy = (void (*)(void *)) free_Xapian_MSetIterator;
  SwigClassMSetIterator.trackObjects = 0;
  
  SwigClassESet.klass = rb_define_class_under(mXapian, "ESet", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESet, (void *) &SwigClassESet);
  rb_define_alloc_func(SwigClassESet.klass, _wrap_ESet_allocate);
  rb_define_method(SwigClassESet.klass, "initialize", VALUEFUNC(_wrap_new_ESet), -1);
  rb_define_method(SwigClassESet.klass, "size", VALUEFUNC(_wrap_ESet_size), -1);
  rb_define_method(SwigClassESet.klass, "empty?", VALUEFUNC(_wrap_ESet_emptyq___), -1);
  rb_define_method(SwigClassESet.klass, "ebound", VALUEFUNC(_wrap_ESet_ebound), -1);
  rb_define_method(SwigClassESet.klass, "_begin", VALUEFUNC(_wrap_ESet__begin), -1);
  rb_define_method(SwigClassESet.klass, "_end", VALUEFUNC(_wrap_ESet__end), -1);
  rb_define_method(SwigClassESet.klass, "_back", VALUEFUNC(_wrap_ESet__back), -1);
  rb_define_method(SwigClassESet.klass, "description", VALUEFUNC(_wrap_ESet_description), -1);
  SwigClassESet.mark = 0;
  SwigClassESet.destroy = (void (*)(void *)) free_Xapian_ESet;
  SwigClassESet.trackObjects = 0;
  
  SwigClassESetIterator.klass = rb_define_class_under(mXapian, "ESetIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESetIterator, (void *) &SwigClassESetIterator);
  rb_define_alloc_func(SwigClassESetIterator.klass, _wrap_ESetIterator_allocate);
  rb_define_method(SwigClassESetIterator.klass, "initialize", VALUEFUNC(_wrap_new_ESetIterator), -1);
  rb_define_method(SwigClassESetIterator.klass, "eset=", VALUEFUNC(_wrap_ESetIterator_eset_set), -1);
  rb_define_method(SwigClassESetIterator.klass, "eset", VALUEFUNC(_wrap_ESetIterator_eset_get), -1);
  rb_define_method(SwigClassESetIterator.klass, "off_from_end=", VALUEFUNC(_wrap_ESetIterator_off_from_end_set), -1);
  rb_define_method(SwigClassESetIterator.klass, "off_from_end", VALUEFUNC(_wrap_ESetIterator_off_from_end_get), -1);
  rb_define_method(SwigClassESetIterator.klass, "weight", VALUEFUNC(_wrap_ESetIterator_weight), -1);
  rb_define_method(SwigClassESetIterator.klass, "description", VALUEFUNC(_wrap_ESetIterator_description), -1);
  rb_define_method(SwigClassESetIterator.klass, "equals", VALUEFUNC(_wrap_ESetIterator_equals), -1);
  rb_define_method(SwigClassESetIterator.klass, "term", VALUEFUNC(_wrap_ESetIterator_term), -1);
  rb_define_method(SwigClassESetIterator.klass, "next", VALUEFUNC(_wrap_ESetIterator_next), -1);
  rb_define_method(SwigClassESetIterator.klass, "prev", VALUEFUNC(_wrap_ESetIterator_prev), -1);
  SwigClassESetIterator.mark = 0;
  SwigClassESetIterator.destroy = (void (*)(void *)) free_Xapian_ESetIterator;
  SwigClassESetIterator.trackObjects = 0;
  rb_define_module_function(mXapian, "==", VALUEFUNC(_wrap___eq__), -1);
  rb_define_module_function(mXapian, "<", VALUEFUNC(_wrap___lt__), -1);
  rb_define_module_function(mXapian, ">", VALUEFUNC(_wrap___gt__), -1);
  rb_define_module_function(mXapian, ">=", VALUEFUNC(_wrap___ge__), -1);
  rb_define_module_function(mXapian, "<=", VALUEFUNC(_wrap___le__), -1);
  rb_define_module_function(mXapian, "+", VALUEFUNC(_wrap___add__), -1);
  
  SwigClassRSet.klass = rb_define_class_under(mXapian, "RSet", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__RSet, (void *) &SwigClassRSet);
  rb_define_alloc_func(SwigClassRSet.klass, _wrap_RSet_allocate);
  rb_define_method(SwigClassRSet.klass, "initialize", VALUEFUNC(_wrap_new_RSet), -1);
  rb_define_method(SwigClassRSet.klass, "size", VALUEFUNC(_wrap_RSet_size), -1);
  rb_define_method(SwigClassRSet.klass, "empty?", VALUEFUNC(_wrap_RSet_emptyq___), -1);
  rb_define_method(SwigClassRSet.klass, "add_document", VALUEFUNC(_wrap_RSet_add_document), -1);
  rb_define_method(SwigClassRSet.klass, "remove_document", VALUEFUNC(_wrap_RSet_remove_document), -1);
  rb_define_method(SwigClassRSet.klass, "contains", VALUEFUNC(_wrap_RSet_contains), -1);
  rb_define_method(SwigClassRSet.klass, "description", VALUEFUNC(_wrap_RSet_description), -1);
  SwigClassRSet.mark = 0;
  SwigClassRSet.destroy = (void (*)(void *)) free_Xapian_RSet;
  SwigClassRSet.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_MatchDecider", VALUEFUNC(_wrap_disown_MatchDecider), -1);
  
  SwigClassMatchDecider.klass = rb_define_class_under(mXapian, "MatchDecider", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__MatchDecider, (void *) &SwigClassMatchDecider);
  rb_define_alloc_func(SwigClassMatchDecider.klass, _wrap_MatchDecider_allocate);
  rb_define_method(SwigClassMatchDecider.klass, "initialize", VALUEFUNC(_wrap_new_MatchDecider), -1);
  rb_define_method(SwigClassMatchDecider.klass, "call", VALUEFUNC(_wrap_MatchDecider___call__), -1);
  SwigClassMatchDecider.mark = 0;
  SwigClassMatchDecider.destroy = (void (*)(void *)) free_Xapian_MatchDecider;
  SwigClassMatchDecider.trackObjects = 0;
  
  SwigClassEnquire.klass = rb_define_class_under(mXapian, "Enquire", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Enquire, (void *) &SwigClassEnquire);
  rb_define_alloc_func(SwigClassEnquire.klass, _wrap_Enquire_allocate);
  rb_define_method(SwigClassEnquire.klass, "initialize", VALUEFUNC(_wrap_new_Enquire), -1);
  rb_define_method(SwigClassEnquire.klass, "query!", VALUEFUNC(_wrap_Enquire_queryN___), -1);
  rb_define_method(SwigClassEnquire.klass, "query=", VALUEFUNC(_wrap_Enquire_querye___), -1);
  rb_define_method(SwigClassEnquire.klass, "query", VALUEFUNC(_wrap_Enquire_query), -1);
  rb_define_method(SwigClassEnquire.klass, "add_matchspy", VALUEFUNC(_wrap_Enquire_add_matchspy), -1);
  rb_define_method(SwigClassEnquire.klass, "clear_matchspies", VALUEFUNC(_wrap_Enquire_clear_matchspies), -1);
  rb_define_method(SwigClassEnquire.klass, "weighting_scheme=", VALUEFUNC(_wrap_Enquire_weighting_schemee___), -1);
  rb_define_method(SwigClassEnquire.klass, "set_expansion_scheme", VALUEFUNC(_wrap_Enquire_set_expansion_scheme), -1);
  rb_define_method(SwigClassEnquire.klass, "collapse_key=", VALUEFUNC(_wrap_Enquire_collapse_keye___), -1);
  rb_define_const(SwigClassEnquire.klass, "ASCENDING", SWIG_From_int(static_cast< int >(Xapian::Enquire::ASCENDING)));
  rb_define_const(SwigClassEnquire.klass, "DESCENDING", SWIG_From_int(static_cast< int >(Xapian::Enquire::DESCENDING)));
  rb_define_const(SwigClassEnquire.klass, "DONT_CARE", SWIG_From_int(static_cast< int >(Xapian::Enquire::DONT_CARE)));
  rb_define_method(SwigClassEnquire.klass, "docid_order=", VALUEFUNC(_wrap_Enquire_docid_ordere___), -1);
  rb_define_method(SwigClassEnquire.klass, "cutoff!", VALUEFUNC(_wrap_Enquire_cutoffN___), -1);
  rb_define_method(SwigClassEnquire.klass, "sort_by_relevance!", VALUEFUNC(_wrap_Enquire_sort_by_relevanceN___), -1);
  rb_define_method(SwigClassEnquire.klass, "sort_by_value!", VALUEFUNC(_wrap_Enquire_sort_by_valueN___), -1);
  rb_define_method(SwigClassEnquire.klass, "set_sort_by_key", VALUEFUNC(_wrap_Enquire_set_sort_by_key), -1);
  rb_define_method(SwigClassEnquire.klass, "sort_by_value_then_relevance!", VALUEFUNC(_wrap_Enquire_sort_by_value_then_relevanceN___), -1);
  rb_define_method(SwigClassEnquire.klass, "set_sort_by_key_then_relevance", VALUEFUNC(_wrap_Enquire_set_sort_by_key_then_relevance), -1);
  rb_define_method(SwigClassEnquire.klass, "sort_by_relevance_then_value!", VALUEFUNC(_wrap_Enquire_sort_by_relevance_then_valueN___), -1);
  rb_define_method(SwigClassEnquire.klass, "set_sort_by_relevance_then_key", VALUEFUNC(_wrap_Enquire_set_sort_by_relevance_then_key), -1);
  rb_define_method(SwigClassEnquire.klass, "set_time_limit", VALUEFUNC(_wrap_Enquire_set_time_limit), -1);
  rb_define_method(SwigClassEnquire.klass, "mset", VALUEFUNC(_wrap_Enquire_mset), -1);
  rb_define_const(SwigClassEnquire.klass, "INCLUDE_QUERY_TERMS", SWIG_From_int(static_cast< int >(Xapian::Enquire::INCLUDE_QUERY_TERMS)));
  rb_define_const(SwigClassEnquire.klass, "USE_EXACT_TERMFREQ", SWIG_From_int(static_cast< int >(Xapian::Enquire::USE_EXACT_TERMFREQ)));
  rb_define_method(SwigClassEnquire.klass, "eset", VALUEFUNC(_wrap_Enquire_eset), -1);
  rb_define_method(SwigClassEnquire.klass, "_dangerous_matching_terms_begin", VALUEFUNC(_wrap_Enquire__dangerous_matching_terms_begin), -1);
  rb_define_method(SwigClassEnquire.klass, "_dangerous_matching_terms_end", VALUEFUNC(_wrap_Enquire__dangerous_matching_terms_end), -1);
  rb_define_method(SwigClassEnquire.klass, "description", VALUEFUNC(_wrap_Enquire_description), -1);
  SwigClassEnquire.mark = 0;
  SwigClassEnquire.destroy = (void (*)(void *)) free_Xapian_Enquire;
  SwigClassEnquire.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_ExpandDecider", VALUEFUNC(_wrap_disown_ExpandDecider), -1);
  
  SwigClassExpandDecider.klass = rb_define_class_under(mXapian, "ExpandDecider", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ExpandDecider, (void *) &SwigClassExpandDecider);
  rb_define_alloc_func(SwigClassExpandDecider.klass, _wrap_ExpandDecider_allocate);
  rb_define_method(SwigClassExpandDecider.klass, "initialize", VALUEFUNC(_wrap_new_ExpandDecider), -1);
  rb_define_method(SwigClassExpandDecider.klass, "call", VALUEFUNC(_wrap_ExpandDecider___call__), -1);
  rb_define_method(SwigClassExpandDecider.klass, "release", VALUEFUNC(_wrap_ExpandDecider_release), -1);
  SwigClassExpandDecider.mark = 0;
  SwigClassExpandDecider.destroy = (void (*)(void *)) free_Xapian_ExpandDecider;
  SwigClassExpandDecider.trackObjects = 0;
  
  SwigClassExpandDeciderAnd.klass = rb_define_class_under(mXapian, "ExpandDeciderAnd", ((swig_class *) SWIGTYPE_p_Xapian__ExpandDecider->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ExpandDeciderAnd, (void *) &SwigClassExpandDeciderAnd);
  rb_define_alloc_func(SwigClassExpandDeciderAnd.klass, _wrap_ExpandDeciderAnd_allocate);
  rb_define_method(SwigClassExpandDeciderAnd.klass, "initialize", VALUEFUNC(_wrap_new_ExpandDeciderAnd), -1);
  rb_define_method(SwigClassExpandDeciderAnd.klass, "call", VALUEFUNC(_wrap_ExpandDeciderAnd___call__), -1);
  SwigClassExpandDeciderAnd.mark = 0;
  SwigClassExpandDeciderAnd.destroy = (void (*)(void *)) free_Xapian_ExpandDeciderAnd;
  SwigClassExpandDeciderAnd.trackObjects = 0;
  
  SwigClassExpandDeciderFilterPrefix.klass = rb_define_class_under(mXapian, "ExpandDeciderFilterPrefix", ((swig_class *) SWIGTYPE_p_Xapian__ExpandDecider->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ExpandDeciderFilterPrefix, (void *) &SwigClassExpandDeciderFilterPrefix);
  rb_define_alloc_func(SwigClassExpandDeciderFilterPrefix.klass, _wrap_ExpandDeciderFilterPrefix_allocate);
  rb_define_method(SwigClassExpandDeciderFilterPrefix.klass, "initialize", VALUEFUNC(_wrap_new_ExpandDeciderFilterPrefix), -1);
  rb_define_method(SwigClassExpandDeciderFilterPrefix.klass, "call", VALUEFUNC(_wrap_ExpandDeciderFilterPrefix___call__), -1);
  SwigClassExpandDeciderFilterPrefix.mark = 0;
  SwigClassExpandDeciderFilterPrefix.destroy = (void (*)(void *)) free_Xapian_ExpandDeciderFilterPrefix;
  SwigClassExpandDeciderFilterPrefix.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_KeyMaker", VALUEFUNC(_wrap_disown_KeyMaker), -1);
  
  SwigClassKeyMaker.klass = rb_define_class_under(mXapian, "KeyMaker", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__KeyMaker, (void *) &SwigClassKeyMaker);
  rb_define_alloc_func(SwigClassKeyMaker.klass, _wrap_KeyMaker_allocate);
  rb_define_method(SwigClassKeyMaker.klass, "initialize", VALUEFUNC(_wrap_new_KeyMaker), -1);
  rb_define_method(SwigClassKeyMaker.klass, "call", VALUEFUNC(_wrap_KeyMaker___call__), -1);
  rb_define_method(SwigClassKeyMaker.klass, "release", VALUEFUNC(_wrap_KeyMaker_release), -1);
  SwigClassKeyMaker.mark = 0;
  SwigClassKeyMaker.destroy = (void (*)(void *)) free_Xapian_KeyMaker;
  SwigClassKeyMaker.trackObjects = 0;
  
  SwigClassMultiValueKeyMaker.klass = rb_define_class_under(mXapian, "MultiValueKeyMaker", ((swig_class *) SWIGTYPE_p_Xapian__KeyMaker->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__MultiValueKeyMaker, (void *) &SwigClassMultiValueKeyMaker);
  rb_define_alloc_func(SwigClassMultiValueKeyMaker.klass, _wrap_MultiValueKeyMaker_allocate);
  rb_define_method(SwigClassMultiValueKeyMaker.klass, "initialize", VALUEFUNC(_wrap_new_MultiValueKeyMaker), -1);
  rb_define_method(SwigClassMultiValueKeyMaker.klass, "call", VALUEFUNC(_wrap_MultiValueKeyMaker___call__), -1);
  rb_define_method(SwigClassMultiValueKeyMaker.klass, "add_value", VALUEFUNC(_wrap_MultiValueKeyMaker_add_value), -1);
  SwigClassMultiValueKeyMaker.mark = 0;
  SwigClassMultiValueKeyMaker.destroy = (void (*)(void *)) free_Xapian_MultiValueKeyMaker;
  SwigClassMultiValueKeyMaker.trackObjects = 0;
  rb_define_const(mXapian, "RP_SUFFIX", SWIG_From_int(static_cast< int >(Xapian::RP_SUFFIX)));
  rb_define_const(mXapian, "RP_REPEATED", SWIG_From_int(static_cast< int >(Xapian::RP_REPEATED)));
  rb_define_const(mXapian, "RP_DATE_PREFER_MDY", SWIG_From_int(static_cast< int >(Xapian::RP_DATE_PREFER_MDY)));
  rb_define_module_function(mXapian, "disown_Stopper", VALUEFUNC(_wrap_disown_Stopper), -1);
  
  SwigClassStopper.klass = rb_define_class_under(mXapian, "Stopper", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stopper, (void *) &SwigClassStopper);
  rb_define_alloc_func(SwigClassStopper.klass, _wrap_Stopper_allocate);
  rb_define_method(SwigClassStopper.klass, "initialize", VALUEFUNC(_wrap_new_Stopper), -1);
  rb_define_method(SwigClassStopper.klass, "call", VALUEFUNC(_wrap_Stopper___call__), -1);
  rb_define_method(SwigClassStopper.klass, "description", VALUEFUNC(_wrap_Stopper_description), -1);
  rb_define_method(SwigClassStopper.klass, "release", VALUEFUNC(_wrap_Stopper_release), -1);
  SwigClassStopper.mark = 0;
  SwigClassStopper.destroy = (void (*)(void *)) free_Xapian_Stopper;
  SwigClassStopper.trackObjects = 0;
  
  SwigClassSimpleStopper.klass = rb_define_class_under(mXapian, "SimpleStopper", ((swig_class *) SWIGTYPE_p_Xapian__Stopper->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__SimpleStopper, (void *) &SwigClassSimpleStopper);
  rb_define_alloc_func(SwigClassSimpleStopper.klass, _wrap_SimpleStopper_allocate);
  rb_define_method(SwigClassSimpleStopper.klass, "initialize", VALUEFUNC(_wrap_new_SimpleStopper), -1);
  rb_define_method(SwigClassSimpleStopper.klass, "add", VALUEFUNC(_wrap_SimpleStopper_add), -1);
  rb_define_method(SwigClassSimpleStopper.klass, "call", VALUEFUNC(_wrap_SimpleStopper___call__), -1);
  rb_define_method(SwigClassSimpleStopper.klass, "description", VALUEFUNC(_wrap_SimpleStopper_description), -1);
  SwigClassSimpleStopper.mark = 0;
  SwigClassSimpleStopper.destroy = (void (*)(void *)) free_Xapian_SimpleStopper;
  SwigClassSimpleStopper.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_RangeProcessor", VALUEFUNC(_wrap_disown_RangeProcessor), -1);
  
  SwigClassRangeProcessor.klass = rb_define_class_under(mXapian, "RangeProcessor", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__RangeProcessor, (void *) &SwigClassRangeProcessor);
  rb_define_alloc_func(SwigClassRangeProcessor.klass, _wrap_RangeProcessor_allocate);
  rb_define_method(SwigClassRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_RangeProcessor), -1);
  rb_define_method(SwigClassRangeProcessor.klass, "check_range", VALUEFUNC(_wrap_RangeProcessor_check_range), -1);
  rb_define_method(SwigClassRangeProcessor.klass, "call", VALUEFUNC(_wrap_RangeProcessor___call__), -1);
  rb_define_method(SwigClassRangeProcessor.klass, "release", VALUEFUNC(_wrap_RangeProcessor_release), -1);
  SwigClassRangeProcessor.mark = 0;
  SwigClassRangeProcessor.destroy = (void (*)(void *)) free_Xapian_RangeProcessor;
  SwigClassRangeProcessor.trackObjects = 0;
  
  SwigClassDateRangeProcessor.klass = rb_define_class_under(mXapian, "DateRangeProcessor", ((swig_class *) SWIGTYPE_p_Xapian__RangeProcessor->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__DateRangeProcessor, (void *) &SwigClassDateRangeProcessor);
  rb_define_alloc_func(SwigClassDateRangeProcessor.klass, _wrap_DateRangeProcessor_allocate);
  rb_define_method(SwigClassDateRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_DateRangeProcessor), -1);
  rb_define_method(SwigClassDateRangeProcessor.klass, "call", VALUEFUNC(_wrap_DateRangeProcessor___call__), -1);
  SwigClassDateRangeProcessor.mark = 0;
  SwigClassDateRangeProcessor.destroy = (void (*)(void *)) free_Xapian_DateRangeProcessor;
  SwigClassDateRangeProcessor.trackObjects = 0;
  
  SwigClassNumberRangeProcessor.klass = rb_define_class_under(mXapian, "NumberRangeProcessor", ((swig_class *) SWIGTYPE_p_Xapian__RangeProcessor->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__NumberRangeProcessor, (void *) &SwigClassNumberRangeProcessor);
  rb_define_alloc_func(SwigClassNumberRangeProcessor.klass, _wrap_NumberRangeProcessor_allocate);
  rb_define_method(SwigClassNumberRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_NumberRangeProcessor), -1);
  rb_define_method(SwigClassNumberRangeProcessor.klass, "call", VALUEFUNC(_wrap_NumberRangeProcessor___call__), -1);
  SwigClassNumberRangeProcessor.mark = 0;
  SwigClassNumberRangeProcessor.destroy = (void (*)(void *)) free_Xapian_NumberRangeProcessor;
  SwigClassNumberRangeProcessor.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_ValueRangeProcessor", VALUEFUNC(_wrap_disown_ValueRangeProcessor), -1);
  
  SwigClassValueRangeProcessor.klass = rb_define_class_under(mXapian, "ValueRangeProcessor", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueRangeProcessor, (void *) &SwigClassValueRangeProcessor);
  rb_define_alloc_func(SwigClassValueRangeProcessor.klass, _wrap_ValueRangeProcessor_allocate);
  rb_define_method(SwigClassValueRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_ValueRangeProcessor), -1);
  rb_define_method(SwigClassValueRangeProcessor.klass, "call", VALUEFUNC(_wrap_ValueRangeProcessor___call__), -1);
  rb_define_method(SwigClassValueRangeProcessor.klass, "release", VALUEFUNC(_wrap_ValueRangeProcessor_release), -1);
  SwigClassValueRangeProcessor.mark = 0;
  SwigClassValueRangeProcessor.destroy = (void (*)(void *)) free_Xapian_ValueRangeProcessor;
  SwigClassValueRangeProcessor.trackObjects = 0;
  
  SwigClassStringValueRangeProcessor.klass = rb_define_class_under(mXapian, "StringValueRangeProcessor", ((swig_class *) SWIGTYPE_p_Xapian__ValueRangeProcessor->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__StringValueRangeProcessor, (void *) &SwigClassStringValueRangeProcessor);
  rb_define_alloc_func(SwigClassStringValueRangeProcessor.klass, _wrap_StringValueRangeProcessor_allocate);
  rb_define_method(SwigClassStringValueRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_StringValueRangeProcessor), -1);
  rb_define_method(SwigClassStringValueRangeProcessor.klass, "call", VALUEFUNC(_wrap_StringValueRangeProcessor___call__), -1);
  SwigClassStringValueRangeProcessor.mark = 0;
  SwigClassStringValueRangeProcessor.destroy = (void (*)(void *)) free_Xapian_StringValueRangeProcessor;
  SwigClassStringValueRangeProcessor.trackObjects = 0;
  
  SwigClassDateValueRangeProcessor.klass = rb_define_class_under(mXapian, "DateValueRangeProcessor", ((swig_class *) SWIGTYPE_p_Xapian__StringValueRangeProcessor->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__DateValueRangeProcessor, (void *) &SwigClassDateValueRangeProcessor);
  rb_define_alloc_func(SwigClassDateValueRangeProcessor.klass, _wrap_DateValueRangeProcessor_allocate);
  rb_define_method(SwigClassDateValueRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_DateValueRangeProcessor), -1);
  rb_define_method(SwigClassDateValueRangeProcessor.klass, "call", VALUEFUNC(_wrap_DateValueRangeProcessor___call__), -1);
  SwigClassDateValueRangeProcessor.mark = 0;
  SwigClassDateValueRangeProcessor.destroy = (void (*)(void *)) free_Xapian_DateValueRangeProcessor;
  SwigClassDateValueRangeProcessor.trackObjects = 0;
  
  SwigClassNumberValueRangeProcessor.klass = rb_define_class_under(mXapian, "NumberValueRangeProcessor", ((swig_class *) SWIGTYPE_p_Xapian__StringValueRangeProcessor->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__NumberValueRangeProcessor, (void *) &SwigClassNumberValueRangeProcessor);
  rb_define_alloc_func(SwigClassNumberValueRangeProcessor.klass, _wrap_NumberValueRangeProcessor_allocate);
  rb_define_method(SwigClassNumberValueRangeProcessor.klass, "initialize", VALUEFUNC(_wrap_new_NumberValueRangeProcessor), -1);
  rb_define_method(SwigClassNumberValueRangeProcessor.klass, "call", VALUEFUNC(_wrap_NumberValueRangeProcessor___call__), -1);
  SwigClassNumberValueRangeProcessor.mark = 0;
  SwigClassNumberValueRangeProcessor.destroy = (void (*)(void *)) free_Xapian_NumberValueRangeProcessor;
  SwigClassNumberValueRangeProcessor.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_FieldProcessor", VALUEFUNC(_wrap_disown_FieldProcessor), -1);
  
  SwigClassFieldProcessor.klass = rb_define_class_under(mXapian, "FieldProcessor", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__FieldProcessor, (void *) &SwigClassFieldProcessor);
  rb_define_alloc_func(SwigClassFieldProcessor.klass, _wrap_FieldProcessor_allocate);
  rb_define_method(SwigClassFieldProcessor.klass, "initialize", VALUEFUNC(_wrap_new_FieldProcessor), -1);
  rb_define_method(SwigClassFieldProcessor.klass, "call", VALUEFUNC(_wrap_FieldProcessor___call__), -1);
  rb_define_method(SwigClassFieldProcessor.klass, "release", VALUEFUNC(_wrap_FieldProcessor_release), -1);
  SwigClassFieldProcessor.mark = 0;
  SwigClassFieldProcessor.destroy = (void (*)(void *)) free_Xapian_FieldProcessor;
  SwigClassFieldProcessor.trackObjects = 0;
  
  SwigClassQueryParser.klass = rb_define_class_under(mXapian, "QueryParser", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__QueryParser, (void *) &SwigClassQueryParser);
  rb_define_alloc_func(SwigClassQueryParser.klass, _wrap_QueryParser_allocate);
  rb_define_method(SwigClassQueryParser.klass, "initialize", VALUEFUNC(_wrap_new_QueryParser), -1);
  rb_define_const(SwigClassQueryParser.klass, "FLAG_BOOLEAN", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_BOOLEAN)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_PHRASE", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_PHRASE)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_LOVEHATE", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_LOVEHATE)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_BOOLEAN_ANY_CASE", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_WILDCARD", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_WILDCARD)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_PURE_NOT", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_PURE_NOT)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_PARTIAL", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_PARTIAL)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_SPELLING_CORRECTION", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_SPELLING_CORRECTION)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_SYNONYM", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_SYNONYM)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_AUTO_SYNONYMS", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_AUTO_SYNONYMS)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_AUTO_MULTIWORD_SYNONYMS", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_CJK_NGRAM", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_CJK_NGRAM)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_ACCUMULATE", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_ACCUMULATE)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_NO_POSITIONS", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_NO_POSITIONS)));
  rb_define_const(SwigClassQueryParser.klass, "FLAG_DEFAULT", SWIG_From_int(static_cast< int >(Xapian::QueryParser::FLAG_DEFAULT)));
  rb_define_const(SwigClassQueryParser.klass, "STEM_NONE", SWIG_From_int(static_cast< int >(Xapian::QueryParser::STEM_NONE)));
  rb_define_const(SwigClassQueryParser.klass, "STEM_SOME", SWIG_From_int(static_cast< int >(Xapian::QueryParser::STEM_SOME)));
  rb_define_const(SwigClassQueryParser.klass, "STEM_ALL", SWIG_From_int(static_cast< int >(Xapian::QueryParser::STEM_ALL)));
  rb_define_const(SwigClassQueryParser.klass, "STEM_ALL_Z", SWIG_From_int(static_cast< int >(Xapian::QueryParser::STEM_ALL_Z)));
  rb_define_const(SwigClassQueryParser.klass, "STEM_SOME_FULL_POS", SWIG_From_int(static_cast< int >(Xapian::QueryParser::STEM_SOME_FULL_POS)));
  rb_define_method(SwigClassQueryParser.klass, "stemmer=", VALUEFUNC(_wrap_QueryParser_stemmere___), -1);
  rb_define_method(SwigClassQueryParser.klass, "stemming_strategy=", VALUEFUNC(_wrap_QueryParser_stemming_strategye___), -1);
  rb_define_method(SwigClassQueryParser.klass, "stopper=", VALUEFUNC(_wrap_QueryParser_stoppere___), -1);
  rb_define_method(SwigClassQueryParser.klass, "default_op=", VALUEFUNC(_wrap_QueryParser_default_ope___), -1);
  rb_define_method(SwigClassQueryParser.klass, "default_op", VALUEFUNC(_wrap_QueryParser_default_op), -1);
  rb_define_method(SwigClassQueryParser.klass, "database=", VALUEFUNC(_wrap_QueryParser_databasee___), -1);
  rb_define_method(SwigClassQueryParser.klass, "set_max_expansion", VALUEFUNC(_wrap_QueryParser_set_max_expansion), -1);
  rb_define_method(SwigClassQueryParser.klass, "set_max_wildcard_expansion", VALUEFUNC(_wrap_QueryParser_set_max_wildcard_expansion), -1);
  rb_define_method(SwigClassQueryParser.klass, "parse_query", VALUEFUNC(_wrap_QueryParser_parse_query), -1);
  rb_define_method(SwigClassQueryParser.klass, "add_prefix", VALUEFUNC(_wrap_QueryParser_add_prefix), -1);
  rb_define_method(SwigClassQueryParser.klass, "add_boolean_prefix", VALUEFUNC(_wrap_QueryParser_add_boolean_prefix), -1);
  rb_define_method(SwigClassQueryParser.klass, "_dangerous_stoplist_begin", VALUEFUNC(_wrap_QueryParser__dangerous_stoplist_begin), -1);
  rb_define_method(SwigClassQueryParser.klass, "_dangerous_stoplist_end", VALUEFUNC(_wrap_QueryParser__dangerous_stoplist_end), -1);
  rb_define_method(SwigClassQueryParser.klass, "_dangerous_unstem_begin", VALUEFUNC(_wrap_QueryParser__dangerous_unstem_begin), -1);
  rb_define_method(SwigClassQueryParser.klass, "_dangerous_unstem_end", VALUEFUNC(_wrap_QueryParser__dangerous_unstem_end), -1);
  rb_define_method(SwigClassQueryParser.klass, "add_rangeprocessor", VALUEFUNC(_wrap_QueryParser_add_rangeprocessor), -1);
  rb_define_method(SwigClassQueryParser.klass, "add_valuerangeprocessor", VALUEFUNC(_wrap_QueryParser_add_valuerangeprocessor), -1);
  rb_define_method(SwigClassQueryParser.klass, "get_corrected_query_string", VALUEFUNC(_wrap_QueryParser_get_corrected_query_string), -1);
  rb_define_method(SwigClassQueryParser.klass, "description", VALUEFUNC(_wrap_QueryParser_description), -1);
  SwigClassQueryParser.mark = 0;
  SwigClassQueryParser.destroy = (void (*)(void *)) free_Xapian_QueryParser;
  SwigClassQueryParser.trackObjects = 0;
  rb_define_module_function(mXapian, "sortable_serialise", VALUEFUNC(_wrap_sortable_serialise), -1);
  rb_define_module_function(mXapian, "sortable_unserialise", VALUEFUNC(_wrap_sortable_unserialise), -1);
  
  SwigClassValueSetMatchDecider.klass = rb_define_class_under(mXapian, "ValueSetMatchDecider", ((swig_class *) SWIGTYPE_p_Xapian__MatchDecider->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueSetMatchDecider, (void *) &SwigClassValueSetMatchDecider);
  rb_define_alloc_func(SwigClassValueSetMatchDecider.klass, _wrap_ValueSetMatchDecider_allocate);
  rb_define_method(SwigClassValueSetMatchDecider.klass, "initialize", VALUEFUNC(_wrap_new_ValueSetMatchDecider), -1);
  rb_define_method(SwigClassValueSetMatchDecider.klass, "add_value", VALUEFUNC(_wrap_ValueSetMatchDecider_add_value), -1);
  rb_define_method(SwigClassValueSetMatchDecider.klass, "remove_value", VALUEFUNC(_wrap_ValueSetMatchDecider_remove_value), -1);
  rb_define_method(SwigClassValueSetMatchDecider.klass, "call", VALUEFUNC(_wrap_ValueSetMatchDecider___call__), -1);
  SwigClassValueSetMatchDecider.mark = 0;
  SwigClassValueSetMatchDecider.destroy = (void (*)(void *)) free_Xapian_ValueSetMatchDecider;
  SwigClassValueSetMatchDecider.trackObjects = 0;
  
  SwigClassWeight.klass = rb_define_class_under(mXapian, "Weight", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Weight, (void *) &SwigClassWeight);
  rb_undef_alloc_func(SwigClassWeight.klass);
  rb_define_const(SwigClassWeight.klass, "TWO_STAGE_SMOOTHING", SWIG_From_int(static_cast< int >(Xapian::Weight::TWO_STAGE_SMOOTHING)));
  rb_define_const(SwigClassWeight.klass, "DIRICHLET_SMOOTHING", SWIG_From_int(static_cast< int >(Xapian::Weight::DIRICHLET_SMOOTHING)));
  rb_define_const(SwigClassWeight.klass, "ABSOLUTE_DISCOUNT_SMOOTHING", SWIG_From_int(static_cast< int >(Xapian::Weight::ABSOLUTE_DISCOUNT_SMOOTHING)));
  rb_define_const(SwigClassWeight.klass, "JELINEK_MERCER_SMOOTHING", SWIG_From_int(static_cast< int >(Xapian::Weight::JELINEK_MERCER_SMOOTHING)));
  rb_define_const(SwigClassWeight.klass, "DIRICHLET_PLUS_SMOOTHING", SWIG_From_int(static_cast< int >(Xapian::Weight::DIRICHLET_PLUS_SMOOTHING)));
  rb_define_method(SwigClassWeight.klass, "name", VALUEFUNC(_wrap_Weight_name), -1);
  rb_define_method(SwigClassWeight.klass, "sumpart", VALUEFUNC(_wrap_Weight_sumpart), -1);
  rb_define_method(SwigClassWeight.klass, "maxpart", VALUEFUNC(_wrap_Weight_maxpart), -1);
  rb_define_method(SwigClassWeight.klass, "sumextra", VALUEFUNC(_wrap_Weight_sumextra), -1);
  rb_define_method(SwigClassWeight.klass, "maxextra", VALUEFUNC(_wrap_Weight_maxextra), -1);
  SwigClassWeight.mark = 0;
  SwigClassWeight.destroy = (void (*)(void *)) free_Xapian_Weight;
  SwigClassWeight.trackObjects = 0;
  
  SwigClassBoolWeight.klass = rb_define_class_under(mXapian, "BoolWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__BoolWeight, (void *) &SwigClassBoolWeight);
  rb_define_alloc_func(SwigClassBoolWeight.klass, _wrap_BoolWeight_allocate);
  rb_define_method(SwigClassBoolWeight.klass, "initialize", VALUEFUNC(_wrap_new_BoolWeight), -1);
  rb_define_method(SwigClassBoolWeight.klass, "name", VALUEFUNC(_wrap_BoolWeight_name), -1);
  rb_define_method(SwigClassBoolWeight.klass, "sumpart", VALUEFUNC(_wrap_BoolWeight_sumpart), -1);
  rb_define_method(SwigClassBoolWeight.klass, "maxpart", VALUEFUNC(_wrap_BoolWeight_maxpart), -1);
  rb_define_method(SwigClassBoolWeight.klass, "sumextra", VALUEFUNC(_wrap_BoolWeight_sumextra), -1);
  rb_define_method(SwigClassBoolWeight.klass, "maxextra", VALUEFUNC(_wrap_BoolWeight_maxextra), -1);
  SwigClassBoolWeight.mark = 0;
  SwigClassBoolWeight.destroy = (void (*)(void *)) free_Xapian_BoolWeight;
  SwigClassBoolWeight.trackObjects = 0;
  
  SwigClassTfIdfWeight.klass = rb_define_class_under(mXapian, "TfIdfWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__TfIdfWeight, (void *) &SwigClassTfIdfWeight);
  rb_define_alloc_func(SwigClassTfIdfWeight.klass, _wrap_TfIdfWeight_allocate);
  rb_define_method(SwigClassTfIdfWeight.klass, "initialize", VALUEFUNC(_wrap_new_TfIdfWeight), -1);
  rb_define_method(SwigClassTfIdfWeight.klass, "name", VALUEFUNC(_wrap_TfIdfWeight_name), -1);
  rb_define_method(SwigClassTfIdfWeight.klass, "sumpart", VALUEFUNC(_wrap_TfIdfWeight_sumpart), -1);
  rb_define_method(SwigClassTfIdfWeight.klass, "maxpart", VALUEFUNC(_wrap_TfIdfWeight_maxpart), -1);
  rb_define_method(SwigClassTfIdfWeight.klass, "sumextra", VALUEFUNC(_wrap_TfIdfWeight_sumextra), -1);
  rb_define_method(SwigClassTfIdfWeight.klass, "maxextra", VALUEFUNC(_wrap_TfIdfWeight_maxextra), -1);
  SwigClassTfIdfWeight.mark = 0;
  SwigClassTfIdfWeight.destroy = (void (*)(void *)) free_Xapian_TfIdfWeight;
  SwigClassTfIdfWeight.trackObjects = 0;
  
  SwigClassBM25Weight.klass = rb_define_class_under(mXapian, "BM25Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__BM25Weight, (void *) &SwigClassBM25Weight);
  rb_define_alloc_func(SwigClassBM25Weight.klass, _wrap_BM25Weight_allocate);
  rb_define_method(SwigClassBM25Weight.klass, "initialize", VALUEFUNC(_wrap_new_BM25Weight), -1);
  rb_define_method(SwigClassBM25Weight.klass, "name", VALUEFUNC(_wrap_BM25Weight_name), -1);
  rb_define_method(SwigClassBM25Weight.klass, "sumpart", VALUEFUNC(_wrap_BM25Weight_sumpart), -1);
  rb_define_method(SwigClassBM25Weight.klass, "maxpart", VALUEFUNC(_wrap_BM25Weight_maxpart), -1);
  rb_define_method(SwigClassBM25Weight.klass, "sumextra", VALUEFUNC(_wrap_BM25Weight_sumextra), -1);
  rb_define_method(SwigClassBM25Weight.klass, "maxextra", VALUEFUNC(_wrap_BM25Weight_maxextra), -1);
  SwigClassBM25Weight.mark = 0;
  SwigClassBM25Weight.destroy = (void (*)(void *)) free_Xapian_BM25Weight;
  SwigClassBM25Weight.trackObjects = 0;
  
  SwigClassBM25PlusWeight.klass = rb_define_class_under(mXapian, "BM25PlusWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__BM25PlusWeight, (void *) &SwigClassBM25PlusWeight);
  rb_define_alloc_func(SwigClassBM25PlusWeight.klass, _wrap_BM25PlusWeight_allocate);
  rb_define_method(SwigClassBM25PlusWeight.klass, "initialize", VALUEFUNC(_wrap_new_BM25PlusWeight), -1);
  rb_define_method(SwigClassBM25PlusWeight.klass, "name", VALUEFUNC(_wrap_BM25PlusWeight_name), -1);
  rb_define_method(SwigClassBM25PlusWeight.klass, "sumpart", VALUEFUNC(_wrap_BM25PlusWeight_sumpart), -1);
  rb_define_method(SwigClassBM25PlusWeight.klass, "maxpart", VALUEFUNC(_wrap_BM25PlusWeight_maxpart), -1);
  rb_define_method(SwigClassBM25PlusWeight.klass, "sumextra", VALUEFUNC(_wrap_BM25PlusWeight_sumextra), -1);
  rb_define_method(SwigClassBM25PlusWeight.klass, "maxextra", VALUEFUNC(_wrap_BM25PlusWeight_maxextra), -1);
  SwigClassBM25PlusWeight.mark = 0;
  SwigClassBM25PlusWeight.destroy = (void (*)(void *)) free_Xapian_BM25PlusWeight;
  SwigClassBM25PlusWeight.trackObjects = 0;
  
  SwigClassTradWeight.klass = rb_define_class_under(mXapian, "TradWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__TradWeight, (void *) &SwigClassTradWeight);
  rb_define_alloc_func(SwigClassTradWeight.klass, _wrap_TradWeight_allocate);
  rb_define_method(SwigClassTradWeight.klass, "initialize", VALUEFUNC(_wrap_new_TradWeight), -1);
  rb_define_method(SwigClassTradWeight.klass, "name", VALUEFUNC(_wrap_TradWeight_name), -1);
  rb_define_method(SwigClassTradWeight.klass, "sumpart", VALUEFUNC(_wrap_TradWeight_sumpart), -1);
  rb_define_method(SwigClassTradWeight.klass, "maxpart", VALUEFUNC(_wrap_TradWeight_maxpart), -1);
  rb_define_method(SwigClassTradWeight.klass, "sumextra", VALUEFUNC(_wrap_TradWeight_sumextra), -1);
  rb_define_method(SwigClassTradWeight.klass, "maxextra", VALUEFUNC(_wrap_TradWeight_maxextra), -1);
  SwigClassTradWeight.mark = 0;
  SwigClassTradWeight.destroy = (void (*)(void *)) free_Xapian_TradWeight;
  SwigClassTradWeight.trackObjects = 0;
  
  SwigClassInL2Weight.klass = rb_define_class_under(mXapian, "InL2Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__InL2Weight, (void *) &SwigClassInL2Weight);
  rb_define_alloc_func(SwigClassInL2Weight.klass, _wrap_InL2Weight_allocate);
  rb_define_method(SwigClassInL2Weight.klass, "initialize", VALUEFUNC(_wrap_new_InL2Weight), -1);
  rb_define_method(SwigClassInL2Weight.klass, "name", VALUEFUNC(_wrap_InL2Weight_name), -1);
  rb_define_method(SwigClassInL2Weight.klass, "sumpart", VALUEFUNC(_wrap_InL2Weight_sumpart), -1);
  rb_define_method(SwigClassInL2Weight.klass, "maxpart", VALUEFUNC(_wrap_InL2Weight_maxpart), -1);
  rb_define_method(SwigClassInL2Weight.klass, "sumextra", VALUEFUNC(_wrap_InL2Weight_sumextra), -1);
  rb_define_method(SwigClassInL2Weight.klass, "maxextra", VALUEFUNC(_wrap_InL2Weight_maxextra), -1);
  SwigClassInL2Weight.mark = 0;
  SwigClassInL2Weight.destroy = (void (*)(void *)) free_Xapian_InL2Weight;
  SwigClassInL2Weight.trackObjects = 0;
  
  SwigClassIfB2Weight.klass = rb_define_class_under(mXapian, "IfB2Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__IfB2Weight, (void *) &SwigClassIfB2Weight);
  rb_define_alloc_func(SwigClassIfB2Weight.klass, _wrap_IfB2Weight_allocate);
  rb_define_method(SwigClassIfB2Weight.klass, "initialize", VALUEFUNC(_wrap_new_IfB2Weight), -1);
  rb_define_method(SwigClassIfB2Weight.klass, "name", VALUEFUNC(_wrap_IfB2Weight_name), -1);
  rb_define_method(SwigClassIfB2Weight.klass, "sumpart", VALUEFUNC(_wrap_IfB2Weight_sumpart), -1);
  rb_define_method(SwigClassIfB2Weight.klass, "maxpart", VALUEFUNC(_wrap_IfB2Weight_maxpart), -1);
  rb_define_method(SwigClassIfB2Weight.klass, "sumextra", VALUEFUNC(_wrap_IfB2Weight_sumextra), -1);
  rb_define_method(SwigClassIfB2Weight.klass, "maxextra", VALUEFUNC(_wrap_IfB2Weight_maxextra), -1);
  SwigClassIfB2Weight.mark = 0;
  SwigClassIfB2Weight.destroy = (void (*)(void *)) free_Xapian_IfB2Weight;
  SwigClassIfB2Weight.trackObjects = 0;
  
  SwigClassIneB2Weight.klass = rb_define_class_under(mXapian, "IneB2Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__IneB2Weight, (void *) &SwigClassIneB2Weight);
  rb_define_alloc_func(SwigClassIneB2Weight.klass, _wrap_IneB2Weight_allocate);
  rb_define_method(SwigClassIneB2Weight.klass, "initialize", VALUEFUNC(_wrap_new_IneB2Weight), -1);
  rb_define_method(SwigClassIneB2Weight.klass, "name", VALUEFUNC(_wrap_IneB2Weight_name), -1);
  rb_define_method(SwigClassIneB2Weight.klass, "sumpart", VALUEFUNC(_wrap_IneB2Weight_sumpart), -1);
  rb_define_method(SwigClassIneB2Weight.klass, "maxpart", VALUEFUNC(_wrap_IneB2Weight_maxpart), -1);
  rb_define_method(SwigClassIneB2Weight.klass, "sumextra", VALUEFUNC(_wrap_IneB2Weight_sumextra), -1);
  rb_define_method(SwigClassIneB2Weight.klass, "maxextra", VALUEFUNC(_wrap_IneB2Weight_maxextra), -1);
  SwigClassIneB2Weight.mark = 0;
  SwigClassIneB2Weight.destroy = (void (*)(void *)) free_Xapian_IneB2Weight;
  SwigClassIneB2Weight.trackObjects = 0;
  
  SwigClassBB2Weight.klass = rb_define_class_under(mXapian, "BB2Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__BB2Weight, (void *) &SwigClassBB2Weight);
  rb_define_alloc_func(SwigClassBB2Weight.klass, _wrap_BB2Weight_allocate);
  rb_define_method(SwigClassBB2Weight.klass, "initialize", VALUEFUNC(_wrap_new_BB2Weight), -1);
  rb_define_method(SwigClassBB2Weight.klass, "name", VALUEFUNC(_wrap_BB2Weight_name), -1);
  rb_define_method(SwigClassBB2Weight.klass, "sumpart", VALUEFUNC(_wrap_BB2Weight_sumpart), -1);
  rb_define_method(SwigClassBB2Weight.klass, "maxpart", VALUEFUNC(_wrap_BB2Weight_maxpart), -1);
  rb_define_method(SwigClassBB2Weight.klass, "sumextra", VALUEFUNC(_wrap_BB2Weight_sumextra), -1);
  rb_define_method(SwigClassBB2Weight.klass, "maxextra", VALUEFUNC(_wrap_BB2Weight_maxextra), -1);
  SwigClassBB2Weight.mark = 0;
  SwigClassBB2Weight.destroy = (void (*)(void *)) free_Xapian_BB2Weight;
  SwigClassBB2Weight.trackObjects = 0;
  
  SwigClassDLHWeight.klass = rb_define_class_under(mXapian, "DLHWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__DLHWeight, (void *) &SwigClassDLHWeight);
  rb_define_alloc_func(SwigClassDLHWeight.klass, _wrap_DLHWeight_allocate);
  rb_define_method(SwigClassDLHWeight.klass, "initialize", VALUEFUNC(_wrap_new_DLHWeight), -1);
  rb_define_method(SwigClassDLHWeight.klass, "name", VALUEFUNC(_wrap_DLHWeight_name), -1);
  rb_define_method(SwigClassDLHWeight.klass, "sumpart", VALUEFUNC(_wrap_DLHWeight_sumpart), -1);
  rb_define_method(SwigClassDLHWeight.klass, "maxpart", VALUEFUNC(_wrap_DLHWeight_maxpart), -1);
  rb_define_method(SwigClassDLHWeight.klass, "sumextra", VALUEFUNC(_wrap_DLHWeight_sumextra), -1);
  rb_define_method(SwigClassDLHWeight.klass, "maxextra", VALUEFUNC(_wrap_DLHWeight_maxextra), -1);
  SwigClassDLHWeight.mark = 0;
  SwigClassDLHWeight.destroy = (void (*)(void *)) free_Xapian_DLHWeight;
  SwigClassDLHWeight.trackObjects = 0;
  
  SwigClassPL2Weight.klass = rb_define_class_under(mXapian, "PL2Weight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__PL2Weight, (void *) &SwigClassPL2Weight);
  rb_define_alloc_func(SwigClassPL2Weight.klass, _wrap_PL2Weight_allocate);
  rb_define_method(SwigClassPL2Weight.klass, "initialize", VALUEFUNC(_wrap_new_PL2Weight), -1);
  rb_define_method(SwigClassPL2Weight.klass, "name", VALUEFUNC(_wrap_PL2Weight_name), -1);
  rb_define_method(SwigClassPL2Weight.klass, "sumpart", VALUEFUNC(_wrap_PL2Weight_sumpart), -1);
  rb_define_method(SwigClassPL2Weight.klass, "maxpart", VALUEFUNC(_wrap_PL2Weight_maxpart), -1);
  rb_define_method(SwigClassPL2Weight.klass, "sumextra", VALUEFUNC(_wrap_PL2Weight_sumextra), -1);
  rb_define_method(SwigClassPL2Weight.klass, "maxextra", VALUEFUNC(_wrap_PL2Weight_maxextra), -1);
  SwigClassPL2Weight.mark = 0;
  SwigClassPL2Weight.destroy = (void (*)(void *)) free_Xapian_PL2Weight;
  SwigClassPL2Weight.trackObjects = 0;
  
  SwigClassPL2PlusWeight.klass = rb_define_class_under(mXapian, "PL2PlusWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__PL2PlusWeight, (void *) &SwigClassPL2PlusWeight);
  rb_define_alloc_func(SwigClassPL2PlusWeight.klass, _wrap_PL2PlusWeight_allocate);
  rb_define_method(SwigClassPL2PlusWeight.klass, "initialize", VALUEFUNC(_wrap_new_PL2PlusWeight), -1);
  rb_define_method(SwigClassPL2PlusWeight.klass, "name", VALUEFUNC(_wrap_PL2PlusWeight_name), -1);
  rb_define_method(SwigClassPL2PlusWeight.klass, "sumpart", VALUEFUNC(_wrap_PL2PlusWeight_sumpart), -1);
  rb_define_method(SwigClassPL2PlusWeight.klass, "maxpart", VALUEFUNC(_wrap_PL2PlusWeight_maxpart), -1);
  rb_define_method(SwigClassPL2PlusWeight.klass, "sumextra", VALUEFUNC(_wrap_PL2PlusWeight_sumextra), -1);
  rb_define_method(SwigClassPL2PlusWeight.klass, "maxextra", VALUEFUNC(_wrap_PL2PlusWeight_maxextra), -1);
  SwigClassPL2PlusWeight.mark = 0;
  SwigClassPL2PlusWeight.destroy = (void (*)(void *)) free_Xapian_PL2PlusWeight;
  SwigClassPL2PlusWeight.trackObjects = 0;
  
  SwigClassDPHWeight.klass = rb_define_class_under(mXapian, "DPHWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__DPHWeight, (void *) &SwigClassDPHWeight);
  rb_define_alloc_func(SwigClassDPHWeight.klass, _wrap_DPHWeight_allocate);
  rb_define_method(SwigClassDPHWeight.klass, "initialize", VALUEFUNC(_wrap_new_DPHWeight), -1);
  rb_define_method(SwigClassDPHWeight.klass, "name", VALUEFUNC(_wrap_DPHWeight_name), -1);
  rb_define_method(SwigClassDPHWeight.klass, "sumpart", VALUEFUNC(_wrap_DPHWeight_sumpart), -1);
  rb_define_method(SwigClassDPHWeight.klass, "maxpart", VALUEFUNC(_wrap_DPHWeight_maxpart), -1);
  rb_define_method(SwigClassDPHWeight.klass, "sumextra", VALUEFUNC(_wrap_DPHWeight_sumextra), -1);
  rb_define_method(SwigClassDPHWeight.klass, "maxextra", VALUEFUNC(_wrap_DPHWeight_maxextra), -1);
  SwigClassDPHWeight.mark = 0;
  SwigClassDPHWeight.destroy = (void (*)(void *)) free_Xapian_DPHWeight;
  SwigClassDPHWeight.trackObjects = 0;
  
  SwigClassLMWeight.klass = rb_define_class_under(mXapian, "LMWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LMWeight, (void *) &SwigClassLMWeight);
  rb_define_alloc_func(SwigClassLMWeight.klass, _wrap_LMWeight_allocate);
  rb_define_method(SwigClassLMWeight.klass, "initialize", VALUEFUNC(_wrap_new_LMWeight), -1);
  rb_define_method(SwigClassLMWeight.klass, "name", VALUEFUNC(_wrap_LMWeight_name), -1);
  rb_define_method(SwigClassLMWeight.klass, "sumpart", VALUEFUNC(_wrap_LMWeight_sumpart), -1);
  rb_define_method(SwigClassLMWeight.klass, "maxpart", VALUEFUNC(_wrap_LMWeight_maxpart), -1);
  rb_define_method(SwigClassLMWeight.klass, "sumextra", VALUEFUNC(_wrap_LMWeight_sumextra), -1);
  rb_define_method(SwigClassLMWeight.klass, "maxextra", VALUEFUNC(_wrap_LMWeight_maxextra), -1);
  SwigClassLMWeight.mark = 0;
  SwigClassLMWeight.destroy = (void (*)(void *)) free_Xapian_LMWeight;
  SwigClassLMWeight.trackObjects = 0;
  
  SwigClassCoordWeight.klass = rb_define_class_under(mXapian, "CoordWeight", ((swig_class *) SWIGTYPE_p_Xapian__Weight->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__CoordWeight, (void *) &SwigClassCoordWeight);
  rb_define_alloc_func(SwigClassCoordWeight.klass, _wrap_CoordWeight_allocate);
  rb_define_method(SwigClassCoordWeight.klass, "initialize", VALUEFUNC(_wrap_new_CoordWeight), -1);
  rb_define_method(SwigClassCoordWeight.klass, "init", VALUEFUNC(_wrap_CoordWeight_init), -1);
  rb_define_method(SwigClassCoordWeight.klass, "name", VALUEFUNC(_wrap_CoordWeight_name), -1);
  rb_define_method(SwigClassCoordWeight.klass, "sumpart", VALUEFUNC(_wrap_CoordWeight_sumpart), -1);
  rb_define_method(SwigClassCoordWeight.klass, "maxpart", VALUEFUNC(_wrap_CoordWeight_maxpart), -1);
  rb_define_method(SwigClassCoordWeight.klass, "sumextra", VALUEFUNC(_wrap_CoordWeight_sumextra), -1);
  rb_define_method(SwigClassCoordWeight.klass, "maxextra", VALUEFUNC(_wrap_CoordWeight_maxextra), -1);
  SwigClassCoordWeight.mark = 0;
  SwigClassCoordWeight.destroy = (void (*)(void *)) free_Xapian_CoordWeight;
  SwigClassCoordWeight.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_Compactor", VALUEFUNC(_wrap_disown_Compactor), -1);
  
  SwigClassCompactor.klass = rb_define_class_under(mXapian, "Compactor", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Compactor, (void *) &SwigClassCompactor);
  rb_define_alloc_func(SwigClassCompactor.klass, _wrap_Compactor_allocate);
  rb_define_method(SwigClassCompactor.klass, "initialize", VALUEFUNC(_wrap_new_Compactor), -1);
  rb_define_const(SwigClassCompactor.klass, "STANDARD", SWIG_From_int(static_cast< int >(Xapian::Compactor::STANDARD)));
  rb_define_const(SwigClassCompactor.klass, "FULL", SWIG_From_int(static_cast< int >(Xapian::Compactor::FULL)));
  rb_define_const(SwigClassCompactor.klass, "FULLER", SWIG_From_int(static_cast< int >(Xapian::Compactor::FULLER)));
  rb_define_method(SwigClassCompactor.klass, "set_block_size", VALUEFUNC(_wrap_Compactor_set_block_size), -1);
  rb_define_method(SwigClassCompactor.klass, "set_renumber", VALUEFUNC(_wrap_Compactor_set_renumber), -1);
  rb_define_method(SwigClassCompactor.klass, "set_multipass", VALUEFUNC(_wrap_Compactor_set_multipass), -1);
  rb_define_method(SwigClassCompactor.klass, "set_compaction_level", VALUEFUNC(_wrap_Compactor_set_compaction_level), -1);
  rb_define_method(SwigClassCompactor.klass, "set_destdir", VALUEFUNC(_wrap_Compactor_set_destdir), -1);
  rb_define_method(SwigClassCompactor.klass, "add_source", VALUEFUNC(_wrap_Compactor_add_source), -1);
  rb_define_method(SwigClassCompactor.klass, "compact", VALUEFUNC(_wrap_Compactor_compact), -1);
  rb_define_method(SwigClassCompactor.klass, "set_status", VALUEFUNC(_wrap_Compactor_set_status), -1);
  rb_define_method(SwigClassCompactor.klass, "resolve_duplicate_metadata", VALUEFUNC(_wrap_Compactor_resolve_duplicate_metadata), -1);
  SwigClassCompactor.mark = 0;
  SwigClassCompactor.destroy = (void (*)(void *)) free_Xapian_Compactor;
  SwigClassCompactor.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_PostingSource", VALUEFUNC(_wrap_disown_PostingSource), -1);
  
  SwigClassPostingSource.klass = rb_define_class_under(mXapian, "PostingSource", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__PostingSource, (void *) &SwigClassPostingSource);
  rb_define_alloc_func(SwigClassPostingSource.klass, _wrap_PostingSource_allocate);
  rb_define_method(SwigClassPostingSource.klass, "initialize", VALUEFUNC(_wrap_new_PostingSource), -1);
  rb_define_method(SwigClassPostingSource.klass, "get_termfreq_min", VALUEFUNC(_wrap_PostingSource_get_termfreq_min), -1);
  rb_define_method(SwigClassPostingSource.klass, "get_termfreq_est", VALUEFUNC(_wrap_PostingSource_get_termfreq_est), -1);
  rb_define_method(SwigClassPostingSource.klass, "get_termfreq_max", VALUEFUNC(_wrap_PostingSource_get_termfreq_max), -1);
  rb_define_method(SwigClassPostingSource.klass, "set_maxweight", VALUEFUNC(_wrap_PostingSource_set_maxweight), -1);
  rb_define_method(SwigClassPostingSource.klass, "get_maxweight", VALUEFUNC(_wrap_PostingSource_get_maxweight), -1);
  rb_define_method(SwigClassPostingSource.klass, "weight", VALUEFUNC(_wrap_PostingSource_weight), -1);
  rb_define_method(SwigClassPostingSource.klass, "docid", VALUEFUNC(_wrap_PostingSource_docid), -1);
  rb_define_method(SwigClassPostingSource.klass, "next", VALUEFUNC(_wrap_PostingSource_next), -1);
  rb_define_method(SwigClassPostingSource.klass, "skip_to", VALUEFUNC(_wrap_PostingSource_skip_to), -1);
  rb_define_method(SwigClassPostingSource.klass, "check", VALUEFUNC(_wrap_PostingSource_check), -1);
  rb_define_method(SwigClassPostingSource.klass, "at_end", VALUEFUNC(_wrap_PostingSource_at_end), -1);
  rb_define_method(SwigClassPostingSource.klass, "name", VALUEFUNC(_wrap_PostingSource_name), -1);
  rb_define_method(SwigClassPostingSource.klass, "init", VALUEFUNC(_wrap_PostingSource_init), -1);
  rb_define_method(SwigClassPostingSource.klass, "description", VALUEFUNC(_wrap_PostingSource_description), -1);
  rb_define_method(SwigClassPostingSource.klass, "release", VALUEFUNC(_wrap_PostingSource_release), -1);
  SwigClassPostingSource.mark = 0;
  SwigClassPostingSource.destroy = (void (*)(void *)) free_Xapian_PostingSource;
  SwigClassPostingSource.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_ValuePostingSource", VALUEFUNC(_wrap_disown_ValuePostingSource), -1);
  
  SwigClassValuePostingSource.klass = rb_define_class_under(mXapian, "ValuePostingSource", ((swig_class *) SWIGTYPE_p_Xapian__PostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValuePostingSource, (void *) &SwigClassValuePostingSource);
  rb_define_alloc_func(SwigClassValuePostingSource.klass, _wrap_ValuePostingSource_allocate);
  rb_define_method(SwigClassValuePostingSource.klass, "initialize", VALUEFUNC(_wrap_new_ValuePostingSource), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_termfreq_min", VALUEFUNC(_wrap_ValuePostingSource_get_termfreq_min), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_termfreq_est", VALUEFUNC(_wrap_ValuePostingSource_get_termfreq_est), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_termfreq_max", VALUEFUNC(_wrap_ValuePostingSource_get_termfreq_max), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "next", VALUEFUNC(_wrap_ValuePostingSource_next), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "skip_to", VALUEFUNC(_wrap_ValuePostingSource_skip_to), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "check", VALUEFUNC(_wrap_ValuePostingSource_check), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "at_end", VALUEFUNC(_wrap_ValuePostingSource_at_end), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "docid", VALUEFUNC(_wrap_ValuePostingSource_docid), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "init", VALUEFUNC(_wrap_ValuePostingSource_init), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_database", VALUEFUNC(_wrap_ValuePostingSource_get_database), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_slot", VALUEFUNC(_wrap_ValuePostingSource_get_slot), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "value", VALUEFUNC(_wrap_ValuePostingSource_value), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "done", VALUEFUNC(_wrap_ValuePostingSource_done), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "get_started", VALUEFUNC(_wrap_ValuePostingSource_get_started), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "set_termfreq_min", VALUEFUNC(_wrap_ValuePostingSource_set_termfreq_min), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "set_termfreq_est", VALUEFUNC(_wrap_ValuePostingSource_set_termfreq_est), -1);
  rb_define_method(SwigClassValuePostingSource.klass, "set_termfreq_max", VALUEFUNC(_wrap_ValuePostingSource_set_termfreq_max), -1);
  SwigClassValuePostingSource.mark = 0;
  SwigClassValuePostingSource.destroy = (void (*)(void *)) free_Xapian_ValuePostingSource;
  SwigClassValuePostingSource.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_ValueWeightPostingSource", VALUEFUNC(_wrap_disown_ValueWeightPostingSource), -1);
  
  SwigClassValueWeightPostingSource.klass = rb_define_class_under(mXapian, "ValueWeightPostingSource", ((swig_class *) SWIGTYPE_p_Xapian__ValuePostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueWeightPostingSource, (void *) &SwigClassValueWeightPostingSource);
  rb_define_alloc_func(SwigClassValueWeightPostingSource.klass, _wrap_ValueWeightPostingSource_allocate);
  rb_define_method(SwigClassValueWeightPostingSource.klass, "initialize", VALUEFUNC(_wrap_new_ValueWeightPostingSource), -1);
  rb_define_method(SwigClassValueWeightPostingSource.klass, "weight", VALUEFUNC(_wrap_ValueWeightPostingSource_weight), -1);
  rb_define_method(SwigClassValueWeightPostingSource.klass, "name", VALUEFUNC(_wrap_ValueWeightPostingSource_name), -1);
  rb_define_method(SwigClassValueWeightPostingSource.klass, "init", VALUEFUNC(_wrap_ValueWeightPostingSource_init), -1);
  rb_define_method(SwigClassValueWeightPostingSource.klass, "description", VALUEFUNC(_wrap_ValueWeightPostingSource_description), -1);
  SwigClassValueWeightPostingSource.mark = 0;
  SwigClassValueWeightPostingSource.destroy = (void (*)(void *)) free_Xapian_ValueWeightPostingSource;
  SwigClassValueWeightPostingSource.trackObjects = 0;
  
  SwigClassDecreasingValueWeightPostingSource.klass = rb_define_class_under(mXapian, "DecreasingValueWeightPostingSource", ((swig_class *) SWIGTYPE_p_Xapian__ValueWeightPostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, (void *) &SwigClassDecreasingValueWeightPostingSource);
  rb_define_alloc_func(SwigClassDecreasingValueWeightPostingSource.klass, _wrap_DecreasingValueWeightPostingSource_allocate);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "initialize", VALUEFUNC(_wrap_new_DecreasingValueWeightPostingSource), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "weight", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_weight), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "name", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_name), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "init", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_init), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "next", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_next), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "skip_to", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_skip_to), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "check", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_check), -1);
  rb_define_method(SwigClassDecreasingValueWeightPostingSource.klass, "description", VALUEFUNC(_wrap_DecreasingValueWeightPostingSource_description), -1);
  SwigClassDecreasingValueWeightPostingSource.mark = 0;
  SwigClassDecreasingValueWeightPostingSource.destroy = (void (*)(void *)) free_Xapian_DecreasingValueWeightPostingSource;
  SwigClassDecreasingValueWeightPostingSource.trackObjects = 0;
  
  SwigClassValueMapPostingSource.klass = rb_define_class_under(mXapian, "ValueMapPostingSource", ((swig_class *) SWIGTYPE_p_Xapian__ValuePostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueMapPostingSource, (void *) &SwigClassValueMapPostingSource);
  rb_define_alloc_func(SwigClassValueMapPostingSource.klass, _wrap_ValueMapPostingSource_allocate);
  rb_define_method(SwigClassValueMapPostingSource.klass, "initialize", VALUEFUNC(_wrap_new_ValueMapPostingSource), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "add_mapping", VALUEFUNC(_wrap_ValueMapPostingSource_add_mapping), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "clear_mappings", VALUEFUNC(_wrap_ValueMapPostingSource_clear_mappings), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "set_default_weight", VALUEFUNC(_wrap_ValueMapPostingSource_set_default_weight), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "weight", VALUEFUNC(_wrap_ValueMapPostingSource_weight), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "name", VALUEFUNC(_wrap_ValueMapPostingSource_name), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "init", VALUEFUNC(_wrap_ValueMapPostingSource_init), -1);
  rb_define_method(SwigClassValueMapPostingSource.klass, "description", VALUEFUNC(_wrap_ValueMapPostingSource_description), -1);
  SwigClassValueMapPostingSource.mark = 0;
  SwigClassValueMapPostingSource.destroy = (void (*)(void *)) free_Xapian_ValueMapPostingSource;
  SwigClassValueMapPostingSource.trackObjects = 0;
  
  SwigClassFixedWeightPostingSource.klass = rb_define_class_under(mXapian, "FixedWeightPostingSource", ((swig_class *) SWIGTYPE_p_Xapian__PostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__FixedWeightPostingSource, (void *) &SwigClassFixedWeightPostingSource);
  rb_define_alloc_func(SwigClassFixedWeightPostingSource.klass, _wrap_FixedWeightPostingSource_allocate);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "initialize", VALUEFUNC(_wrap_new_FixedWeightPostingSource), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "get_termfreq_min", VALUEFUNC(_wrap_FixedWeightPostingSource_get_termfreq_min), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "get_termfreq_est", VALUEFUNC(_wrap_FixedWeightPostingSource_get_termfreq_est), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "get_termfreq_max", VALUEFUNC(_wrap_FixedWeightPostingSource_get_termfreq_max), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "weight", VALUEFUNC(_wrap_FixedWeightPostingSource_weight), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "next", VALUEFUNC(_wrap_FixedWeightPostingSource_next), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "skip_to", VALUEFUNC(_wrap_FixedWeightPostingSource_skip_to), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "check", VALUEFUNC(_wrap_FixedWeightPostingSource_check), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "at_end", VALUEFUNC(_wrap_FixedWeightPostingSource_at_end), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "docid", VALUEFUNC(_wrap_FixedWeightPostingSource_docid), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "name", VALUEFUNC(_wrap_FixedWeightPostingSource_name), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "init", VALUEFUNC(_wrap_FixedWeightPostingSource_init), -1);
  rb_define_method(SwigClassFixedWeightPostingSource.klass, "description", VALUEFUNC(_wrap_FixedWeightPostingSource_description), -1);
  SwigClassFixedWeightPostingSource.mark = 0;
  SwigClassFixedWeightPostingSource.destroy = (void (*)(void *)) free_Xapian_FixedWeightPostingSource;
  SwigClassFixedWeightPostingSource.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_MatchSpy", VALUEFUNC(_wrap_disown_MatchSpy), -1);
  
  SwigClassMatchSpy.klass = rb_define_class_under(mXapian, "MatchSpy", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__MatchSpy, (void *) &SwigClassMatchSpy);
  rb_define_alloc_func(SwigClassMatchSpy.klass, _wrap_MatchSpy_allocate);
  rb_define_method(SwigClassMatchSpy.klass, "initialize", VALUEFUNC(_wrap_new_MatchSpy), -1);
  rb_define_method(SwigClassMatchSpy.klass, "call", VALUEFUNC(_wrap_MatchSpy___call__), -1);
  rb_define_method(SwigClassMatchSpy.klass, "name", VALUEFUNC(_wrap_MatchSpy_name), -1);
  rb_define_method(SwigClassMatchSpy.klass, "merge_results", VALUEFUNC(_wrap_MatchSpy_merge_results), -1);
  rb_define_method(SwigClassMatchSpy.klass, "description", VALUEFUNC(_wrap_MatchSpy_description), -1);
  rb_define_method(SwigClassMatchSpy.klass, "release", VALUEFUNC(_wrap_MatchSpy_release), -1);
  SwigClassMatchSpy.mark = 0;
  SwigClassMatchSpy.destroy = (void (*)(void *)) free_Xapian_MatchSpy;
  SwigClassMatchSpy.trackObjects = 0;
  
  SwigClassValueCountMatchSpy.klass = rb_define_class_under(mXapian, "ValueCountMatchSpy", ((swig_class *) SWIGTYPE_p_Xapian__MatchSpy->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueCountMatchSpy, (void *) &SwigClassValueCountMatchSpy);
  rb_define_alloc_func(SwigClassValueCountMatchSpy.klass, _wrap_ValueCountMatchSpy_allocate);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "initialize", VALUEFUNC(_wrap_new_ValueCountMatchSpy), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "get_total", VALUEFUNC(_wrap_ValueCountMatchSpy_get_total), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "_dangerous_values_begin", VALUEFUNC(_wrap_ValueCountMatchSpy__dangerous_values_begin), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "_dangerous_values_end", VALUEFUNC(_wrap_ValueCountMatchSpy__dangerous_values_end), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "_dangerous_top_values_begin", VALUEFUNC(_wrap_ValueCountMatchSpy__dangerous_top_values_begin), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "_dangerous_top_values_end", VALUEFUNC(_wrap_ValueCountMatchSpy__dangerous_top_values_end), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "call", VALUEFUNC(_wrap_ValueCountMatchSpy___call__), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "name", VALUEFUNC(_wrap_ValueCountMatchSpy_name), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "merge_results", VALUEFUNC(_wrap_ValueCountMatchSpy_merge_results), -1);
  rb_define_method(SwigClassValueCountMatchSpy.klass, "description", VALUEFUNC(_wrap_ValueCountMatchSpy_description), -1);
  SwigClassValueCountMatchSpy.mark = 0;
  SwigClassValueCountMatchSpy.destroy = (void (*)(void *)) free_Xapian_ValueCountMatchSpy;
  SwigClassValueCountMatchSpy.trackObjects = 0;
  rb_define_module_function(mXapian, "miles_to_metres", VALUEFUNC(_wrap_miles_to_metres), -1);
  rb_define_module_function(mXapian, "metres_to_miles", VALUEFUNC(_wrap_metres_to_miles), -1);
  
  SwigClassLatLongCoord.klass = rb_define_class_under(mXapian, "LatLongCoord", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongCoord, (void *) &SwigClassLatLongCoord);
  rb_define_alloc_func(SwigClassLatLongCoord.klass, _wrap_LatLongCoord_allocate);
  rb_define_method(SwigClassLatLongCoord.klass, "initialize", VALUEFUNC(_wrap_new_LatLongCoord), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "latitude=", VALUEFUNC(_wrap_LatLongCoord_latitude_set), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "latitude", VALUEFUNC(_wrap_LatLongCoord_latitude_get), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "longitude=", VALUEFUNC(_wrap_LatLongCoord_longitude_set), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "longitude", VALUEFUNC(_wrap_LatLongCoord_longitude_get), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "unserialise", VALUEFUNC(_wrap_LatLongCoord_unserialise), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "serialise", VALUEFUNC(_wrap_LatLongCoord_serialise), -1);
  rb_define_method(SwigClassLatLongCoord.klass, "description", VALUEFUNC(_wrap_LatLongCoord_description), -1);
  SwigClassLatLongCoord.mark = 0;
  SwigClassLatLongCoord.destroy = (void (*)(void *)) free_Xapian_LatLongCoord;
  SwigClassLatLongCoord.trackObjects = 0;
  
  SwigClassLatLongCoordsIterator.klass = rb_define_class_under(mXapian, "LatLongCoordsIterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongCoordsIterator, (void *) &SwigClassLatLongCoordsIterator);
  rb_define_alloc_func(SwigClassLatLongCoordsIterator.klass, _wrap_LatLongCoordsIterator_allocate);
  rb_define_method(SwigClassLatLongCoordsIterator.klass, "initialize", VALUEFUNC(_wrap_new_LatLongCoordsIterator), -1);
  rb_define_method(SwigClassLatLongCoordsIterator.klass, "==", VALUEFUNC(_wrap_LatLongCoordsIterator___eq__), -1);
  rb_define_method(SwigClassLatLongCoordsIterator.klass, "equals", VALUEFUNC(_wrap_LatLongCoordsIterator_equals), -1);
  rb_define_method(SwigClassLatLongCoordsIterator.klass, "get_coord", VALUEFUNC(_wrap_LatLongCoordsIterator_get_coord), -1);
  rb_define_method(SwigClassLatLongCoordsIterator.klass, "next", VALUEFUNC(_wrap_LatLongCoordsIterator_next), -1);
  SwigClassLatLongCoordsIterator.mark = 0;
  SwigClassLatLongCoordsIterator.destroy = (void (*)(void *)) free_Xapian_LatLongCoordsIterator;
  SwigClassLatLongCoordsIterator.trackObjects = 0;
  
  SwigClassLatLongCoords.klass = rb_define_class_under(mXapian, "LatLongCoords", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongCoords, (void *) &SwigClassLatLongCoords);
  rb_define_alloc_func(SwigClassLatLongCoords.klass, _wrap_LatLongCoords_allocate);
  rb_define_method(SwigClassLatLongCoords.klass, "initialize", VALUEFUNC(_wrap_new_LatLongCoords), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "_begin", VALUEFUNC(_wrap_LatLongCoords__begin), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "_end", VALUEFUNC(_wrap_LatLongCoords__end), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "size", VALUEFUNC(_wrap_LatLongCoords_size), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "empty?", VALUEFUNC(_wrap_LatLongCoords_emptyq___), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "append", VALUEFUNC(_wrap_LatLongCoords_append), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "unserialise", VALUEFUNC(_wrap_LatLongCoords_unserialise), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "serialise", VALUEFUNC(_wrap_LatLongCoords_serialise), -1);
  rb_define_method(SwigClassLatLongCoords.klass, "description", VALUEFUNC(_wrap_LatLongCoords_description), -1);
  SwigClassLatLongCoords.mark = 0;
  SwigClassLatLongCoords.destroy = (void (*)(void *)) free_Xapian_LatLongCoords;
  SwigClassLatLongCoords.trackObjects = 0;
  rb_define_module_function(mXapian, "disown_LatLongMetric", VALUEFUNC(_wrap_disown_LatLongMetric), -1);
  
  SwigClassLatLongMetric.klass = rb_define_class_under(mXapian, "LatLongMetric", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongMetric, (void *) &SwigClassLatLongMetric);
  rb_define_alloc_func(SwigClassLatLongMetric.klass, _wrap_LatLongMetric_allocate);
  rb_define_method(SwigClassLatLongMetric.klass, "initialize", VALUEFUNC(_wrap_new_LatLongMetric), -1);
  rb_define_method(SwigClassLatLongMetric.klass, "pointwise_distance", VALUEFUNC(_wrap_LatLongMetric_pointwise_distance), -1);
  rb_define_method(SwigClassLatLongMetric.klass, "call", VALUEFUNC(_wrap_LatLongMetric___call__), -1);
  rb_define_method(SwigClassLatLongMetric.klass, "name", VALUEFUNC(_wrap_LatLongMetric_name), -1);
  SwigClassLatLongMetric.mark = 0;
  SwigClassLatLongMetric.destroy = (void (*)(void *)) free_Xapian_LatLongMetric;
  SwigClassLatLongMetric.trackObjects = 0;
  
  SwigClassGreatCircleMetric.klass = rb_define_class_under(mXapian, "GreatCircleMetric", ((swig_class *) SWIGTYPE_p_Xapian__LatLongMetric->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__GreatCircleMetric, (void *) &SwigClassGreatCircleMetric);
  rb_define_alloc_func(SwigClassGreatCircleMetric.klass, _wrap_GreatCircleMetric_allocate);
  rb_define_method(SwigClassGreatCircleMetric.klass, "initialize", VALUEFUNC(_wrap_new_GreatCircleMetric), -1);
  rb_define_method(SwigClassGreatCircleMetric.klass, "pointwise_distance", VALUEFUNC(_wrap_GreatCircleMetric_pointwise_distance), -1);
  rb_define_method(SwigClassGreatCircleMetric.klass, "name", VALUEFUNC(_wrap_GreatCircleMetric_name), -1);
  SwigClassGreatCircleMetric.mark = 0;
  SwigClassGreatCircleMetric.destroy = (void (*)(void *)) free_Xapian_GreatCircleMetric;
  SwigClassGreatCircleMetric.trackObjects = 0;
  
  SwigClassLatLongDistancePostingSource.klass = rb_define_class_under(mXapian, "LatLongDistancePostingSource", ((swig_class *) SWIGTYPE_p_Xapian__ValuePostingSource->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongDistancePostingSource, (void *) &SwigClassLatLongDistancePostingSource);
  rb_define_alloc_func(SwigClassLatLongDistancePostingSource.klass, _wrap_LatLongDistancePostingSource_allocate);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "initialize", VALUEFUNC(_wrap_new_LatLongDistancePostingSource), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "next", VALUEFUNC(_wrap_LatLongDistancePostingSource_next), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "skip_to", VALUEFUNC(_wrap_LatLongDistancePostingSource_skip_to), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "check", VALUEFUNC(_wrap_LatLongDistancePostingSource_check), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "weight", VALUEFUNC(_wrap_LatLongDistancePostingSource_weight), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "name", VALUEFUNC(_wrap_LatLongDistancePostingSource_name), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "init", VALUEFUNC(_wrap_LatLongDistancePostingSource_init), -1);
  rb_define_method(SwigClassLatLongDistancePostingSource.klass, "description", VALUEFUNC(_wrap_LatLongDistancePostingSource_description), -1);
  SwigClassLatLongDistancePostingSource.mark = 0;
  SwigClassLatLongDistancePostingSource.destroy = (void (*)(void *)) free_Xapian_LatLongDistancePostingSource;
  SwigClassLatLongDistancePostingSource.trackObjects = 0;
  
  SwigClassLatLongDistanceKeyMaker.klass = rb_define_class_under(mXapian, "LatLongDistanceKeyMaker", ((swig_class *) SWIGTYPE_p_Xapian__KeyMaker->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__LatLongDistanceKeyMaker, (void *) &SwigClassLatLongDistanceKeyMaker);
  rb_define_alloc_func(SwigClassLatLongDistanceKeyMaker.klass, _wrap_LatLongDistanceKeyMaker_allocate);
  rb_define_method(SwigClassLatLongDistanceKeyMaker.klass, "initialize", VALUEFUNC(_wrap_new_LatLongDistanceKeyMaker), -1);
  rb_define_method(SwigClassLatLongDistanceKeyMaker.klass, "call", VALUEFUNC(_wrap_LatLongDistanceKeyMaker___call__), -1);
  SwigClassLatLongDistanceKeyMaker.mark = 0;
  SwigClassLatLongDistanceKeyMaker.destroy = (void (*)(void *)) free_Xapian_LatLongDistanceKeyMaker;
  SwigClassLatLongDistanceKeyMaker.trackObjects = 0;
  
  SwigClassDatabase.klass = rb_define_class_under(mXapian, "Database", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__Database, (void *) &SwigClassDatabase);
  rb_define_alloc_func(SwigClassDatabase.klass, _wrap_Database_allocate);
  rb_define_method(SwigClassDatabase.klass, "initialize", VALUEFUNC(_wrap_new_Database), -1);
  rb_define_method(SwigClassDatabase.klass, "add_database", VALUEFUNC(_wrap_Database_add_database), -1);
  rb_define_method(SwigClassDatabase.klass, "size", VALUEFUNC(_wrap_Database_size), -1);
  rb_define_method(SwigClassDatabase.klass, "reopen", VALUEFUNC(_wrap_Database_reopen), -1);
  rb_define_method(SwigClassDatabase.klass, "close", VALUEFUNC(_wrap_Database_close), -1);
  rb_define_method(SwigClassDatabase.klass, "description", VALUEFUNC(_wrap_Database_description), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_postlist_begin", VALUEFUNC(_wrap_Database__dangerous_postlist_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_postlist_end", VALUEFUNC(_wrap_Database__dangerous_postlist_end), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_termlist_begin", VALUEFUNC(_wrap_Database__dangerous_termlist_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_termlist_end", VALUEFUNC(_wrap_Database__dangerous_termlist_end), -1);
  rb_define_method(SwigClassDatabase.klass, "has_positions", VALUEFUNC(_wrap_Database_has_positions), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_positionlist_begin", VALUEFUNC(_wrap_Database__dangerous_positionlist_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_positionlist_end", VALUEFUNC(_wrap_Database__dangerous_positionlist_end), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_allterms_begin", VALUEFUNC(_wrap_Database__dangerous_allterms_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_allterms_end", VALUEFUNC(_wrap_Database__dangerous_allterms_end), -1);
  rb_define_method(SwigClassDatabase.klass, "doccount", VALUEFUNC(_wrap_Database_doccount), -1);
  rb_define_method(SwigClassDatabase.klass, "lastdocid", VALUEFUNC(_wrap_Database_lastdocid), -1);
  rb_define_method(SwigClassDatabase.klass, "avlength", VALUEFUNC(_wrap_Database_avlength), -1);
  rb_define_method(SwigClassDatabase.klass, "get_average_length", VALUEFUNC(_wrap_Database_get_average_length), -1);
  rb_define_method(SwigClassDatabase.klass, "get_total_length", VALUEFUNC(_wrap_Database_get_total_length), -1);
  rb_define_method(SwigClassDatabase.klass, "termfreq", VALUEFUNC(_wrap_Database_termfreq), -1);
  rb_define_method(SwigClassDatabase.klass, "term_exists", VALUEFUNC(_wrap_Database_term_exists), -1);
  rb_define_method(SwigClassDatabase.klass, "collection_freq", VALUEFUNC(_wrap_Database_collection_freq), -1);
  rb_define_method(SwigClassDatabase.klass, "get_value_freq", VALUEFUNC(_wrap_Database_get_value_freq), -1);
  rb_define_method(SwigClassDatabase.klass, "get_value_lower_bound", VALUEFUNC(_wrap_Database_get_value_lower_bound), -1);
  rb_define_method(SwigClassDatabase.klass, "get_value_upper_bound", VALUEFUNC(_wrap_Database_get_value_upper_bound), -1);
  rb_define_method(SwigClassDatabase.klass, "get_doclength_lower_bound", VALUEFUNC(_wrap_Database_get_doclength_lower_bound), -1);
  rb_define_method(SwigClassDatabase.klass, "get_doclength_upper_bound", VALUEFUNC(_wrap_Database_get_doclength_upper_bound), -1);
  rb_define_method(SwigClassDatabase.klass, "get_wdf_upper_bound", VALUEFUNC(_wrap_Database_get_wdf_upper_bound), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_valuestream_begin", VALUEFUNC(_wrap_Database__dangerous_valuestream_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_valuestream_end", VALUEFUNC(_wrap_Database__dangerous_valuestream_end), -1);
  rb_define_method(SwigClassDatabase.klass, "doclength", VALUEFUNC(_wrap_Database_doclength), -1);
  rb_define_method(SwigClassDatabase.klass, "get_unique_terms", VALUEFUNC(_wrap_Database_get_unique_terms), -1);
  rb_define_method(SwigClassDatabase.klass, "keep_alive", VALUEFUNC(_wrap_Database_keep_alive), -1);
  rb_define_method(SwigClassDatabase.klass, "document", VALUEFUNC(_wrap_Database_document), -1);
  rb_define_method(SwigClassDatabase.klass, "get_spelling_suggestion", VALUEFUNC(_wrap_Database_get_spelling_suggestion), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_spellings_begin", VALUEFUNC(_wrap_Database__dangerous_spellings_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_spellings_end", VALUEFUNC(_wrap_Database__dangerous_spellings_end), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_synonyms_begin", VALUEFUNC(_wrap_Database__dangerous_synonyms_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_synonyms_end", VALUEFUNC(_wrap_Database__dangerous_synonyms_end), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_synonym_keys_begin", VALUEFUNC(_wrap_Database__dangerous_synonym_keys_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_synonym_keys_end", VALUEFUNC(_wrap_Database__dangerous_synonym_keys_end), -1);
  rb_define_method(SwigClassDatabase.klass, "get_metadata", VALUEFUNC(_wrap_Database_get_metadata), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_metadata_keys_begin", VALUEFUNC(_wrap_Database__dangerous_metadata_keys_begin), -1);
  rb_define_method(SwigClassDatabase.klass, "_dangerous_metadata_keys_end", VALUEFUNC(_wrap_Database__dangerous_metadata_keys_end), -1);
  rb_define_method(SwigClassDatabase.klass, "get_uuid", VALUEFUNC(_wrap_Database_get_uuid), -1);
  rb_define_method(SwigClassDatabase.klass, "locked", VALUEFUNC(_wrap_Database_locked), -1);
  rb_define_method(SwigClassDatabase.klass, "get_revision", VALUEFUNC(_wrap_Database_get_revision), -1);
  rb_define_singleton_method(SwigClassDatabase.klass, "check", VALUEFUNC(_wrap_Database_check), -1);
  rb_define_method(SwigClassDatabase.klass, "compact", VALUEFUNC(_wrap_Database_compact), -1);
  SwigClassDatabase.mark = 0;
  SwigClassDatabase.destroy = (void (*)(void *)) free_Xapian_Database;
  SwigClassDatabase.trackObjects = 0;
  
  SwigClassWritableDatabase.klass = rb_define_class_under(mXapian, "WritableDatabase", ((swig_class *) SWIGTYPE_p_Xapian__Database->clientdata)->klass);
  SWIG_TypeClientData(SWIGTYPE_p_Xapian__WritableDatabase, (void *) &SwigClassWritableDatabase);
  rb_define_alloc_func(SwigClassWritableDatabase.klass, _wrap_WritableDatabase_allocate);
  rb_define_method(SwigClassWritableDatabase.klass, "initialize", VALUEFUNC(_wrap_new_WritableDatabase), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "add_database", VALUEFUNC(_wrap_WritableDatabase_add_database), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "commit", VALUEFUNC(_wrap_WritableDatabase_commit), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "flush", VALUEFUNC(_wrap_WritableDatabase_flush), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "begin_transaction", VALUEFUNC(_wrap_WritableDatabase_begin_transaction), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "commit_transaction", VALUEFUNC(_wrap_WritableDatabase_commit_transaction), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "cancel_transaction", VALUEFUNC(_wrap_WritableDatabase_cancel_transaction), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "add_document", VALUEFUNC(_wrap_WritableDatabase_add_document), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "delete_document", VALUEFUNC(_wrap_WritableDatabase_delete_document), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "replace_document", VALUEFUNC(_wrap_WritableDatabase_replace_document), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "add_spelling", VALUEFUNC(_wrap_WritableDatabase_add_spelling), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "remove_spelling", VALUEFUNC(_wrap_WritableDatabase_remove_spelling), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "add_synonym", VALUEFUNC(_wrap_WritableDatabase_add_synonym), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "remove_synonym", VALUEFUNC(_wrap_WritableDatabase_remove_synonym), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "clear_synonyms", VALUEFUNC(_wrap_WritableDatabase_clear_synonyms), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "set_metadata", VALUEFUNC(_wrap_WritableDatabase_set_metadata), -1);
  rb_define_method(SwigClassWritableDatabase.klass, "description", VALUEFUNC(_wrap_WritableDatabase_description), -1);
  SwigClassWritableDatabase.mark = 0;
  SwigClassWritableDatabase.destroy = (void (*)(void *)) free_Xapian_WritableDatabase;
  SwigClassWritableDatabase.trackObjects = 0;
  rb_define_module_function(mXapian, "open_stub", VALUEFUNC(_wrap_open_stub), -1);
  rb_define_module_function(mXapian, "inmemory_open", VALUEFUNC(_wrap_inmemory_open), -1);
  rb_define_module_function(mXapian, "chert_open", VALUEFUNC(_wrap_chert_open), -1);
  rb_define_module_function(mXapian, "remote_open", VALUEFUNC(_wrap_remote_open), -1);
  rb_define_module_function(mXapian, "remote_open_writable", VALUEFUNC(_wrap_remote_open_writable), -1);
  
  // Define MatchAll and MatchNothing as constants in class Xapian::Query.
  rb_define_const(SwigClassQuery.klass, "MatchAll", SWIG_NewPointerObj(SWIG_as_voidptr(new Xapian::Query("")), SWIGTYPE_p_Xapian__Query, 0));;
  rb_define_const(SwigClassQuery.klass, "MatchNothing", SWIG_NewPointerObj(SWIG_as_voidptr(new Xapian::Query()), SWIGTYPE_p_Xapian__Query, 0));;
  
}

