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

xapian_wrap.cc

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


#ifdef __cplusplus
template<class T> class SwigValueWrapper {
    T *tt;
public:
    SwigValueWrapper() : tt(0) { }
    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
    SwigValueWrapper(const T& t) : tt(new T(t)) { }
    ~SwigValueWrapper() { delete tt; } 
    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
    operator T&() const { return *tt; }
    T *operator&() { return tt; }
private:
    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
#endif

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

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC)
#   if (__SUNPRO_CC <= 0x560)
#     define SWIGTEMPLATEDISAMBIGUATOR template
#   else
#     define SWIGTEMPLATEDISAMBIGUATOR 
#   endif
# else
#   define SWIGTEMPLATEDISAMBIGUATOR 
# endif
#endif

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

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

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

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

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

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

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

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

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


#include <stdio.h>
#include <tcl.h>
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>

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

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

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

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the swig runtime code.
  In 99.9% of the cases, swig just needs to declare them as 'static'.
  
  But only do this if is strictly necessary, ie, if you have problems
  with your compiler or so.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

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

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

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


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

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

   Now you can be more explicit as:

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

   that seems to be the same, but now you can also do

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

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

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

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

       int food(double)
       int fooi(int);

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

   just use the SWIG_AddCast()/SWIG_CheckState()


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

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


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




#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

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

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

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

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

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


/* think of this as a c++ template<> or a scheme macro */
#define SWIG_TypeCheck_Template(comparison, ty)         \
  if (ty) {                                             \
    swig_cast_info *iter = ty->cast;                    \
    while (iter) {                                      \
      if (comparison) {                                 \
        if (iter == ty->cast) return iter;              \
        /* Move iter to the top of the linked list */   \
        iter->prev->next = iter->next;                  \
        if (iter->next)                                 \
          iter->next->prev = iter->prev;                \
        iter->next = ty->cast;                          \
        iter->prev = 0;                                 \
        if (ty->cast) ty->cast->prev = iter;            \
        ty->cast = iter;                                \
        return iter;                                    \
      }                                                 \
      iter = iter->next;                                \
    }                                                   \
  }                                                     \
  return 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef __cplusplus
}
#endif

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



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

SWIGINTERN const char*
SWIG_Tcl_ErrorType(int code) {
  const char* type = 0;
  switch(code) {
  case SWIG_MemoryError:
    type = "MemoryError";
    break;
  case SWIG_IOError:
    type = "IOError";
    break;
  case SWIG_RuntimeError:
    type = "RuntimeError";
    break;
  case SWIG_IndexError:
    type = "IndexError";
    break;
  case SWIG_TypeError:
    type = "TypeError";
    break;
  case SWIG_DivisionByZero:
    type = "ZeroDivisionError";
    break;
  case SWIG_OverflowError:
    type = "OverflowError";
    break;
  case SWIG_SyntaxError:
    type = "SyntaxError";
    break;
  case SWIG_ValueError:
    type = "ValueError";
    break;
  case SWIG_SystemError:
    type = "SystemError";
    break;
  case SWIG_AttributeError:
    type = "AttributeError";
    break;
  default:
    type = "RuntimeError";
  }
  return type;
}


SWIGINTERN void
SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj)
{
  Tcl_ResetResult(interp);
  Tcl_SetObjResult(interp, obj);
  Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
}

SWIGINTERN void
SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg)
{
  Tcl_ResetResult(interp);
  Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
  Tcl_AppendResult(interp, ctype, " ", mesg, NULL);
  /*
  Tcl_AddErrorInfo(interp, ctype);
  Tcl_AddErrorInfo(interp, " ");
  Tcl_AddErrorInfo(interp, mesg);
  */
}

SWIGINTERNINLINE void
SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg)
{
  Tcl_AddErrorInfo(interp, mesg);
}



/* -----------------------------------------------------------------------------
 * SWIG API. Portion that goes into the runtime
 * ----------------------------------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
#endif

/* -----------------------------------------------------------------------------
 * Constant declarations
 * ----------------------------------------------------------------------------- */

/* Constant Types */
#define SWIG_TCL_POINTER 4
#define SWIG_TCL_BINARY  5

/* Constant information structure */
typedef struct swig_const_info {
    int type;
    char *name;
    long lvalue;
    double dvalue;
    void   *pvalue;
    swig_type_info **ptype;
} swig_const_info;

typedef int   (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
typedef int   (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int);
typedef void  (*swig_delete_func)(ClientData);

typedef struct swig_method {
  const char     *name;
  swig_wrapper   method;
} swig_method;

typedef struct swig_attribute {
  const char     *name;
  swig_wrapper   getmethod;
  swig_wrapper   setmethod;
} swig_attribute;

typedef struct swig_class {
  const char         *name;
  swig_type_info   **type;
  swig_wrapper       constructor;
  void              (*destructor)(void *);
  swig_method        *methods;
  swig_attribute     *attributes;
  struct swig_class **bases;
  char              **base_names;
  swig_module_info   *module;
} swig_class;

typedef struct swig_instance {
  Tcl_Obj       *thisptr;
  void          *thisvalue;
  swig_class   *classptr;
  int            destroy;
  Tcl_Command    cmdtok;
} swig_instance;

/* Structure for command table */
typedef struct {
  const char *name;
  int       (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
  ClientData  clientdata;
} swig_command_info;

/* Structure for variable linking table */
typedef struct {
  const char *name;
  void *addr;
  char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);
  char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);
} swig_var_info;


/* -----------------------------------------------------------------------------*
 *  Install a constant object 
 * -----------------------------------------------------------------------------*/

static Tcl_HashTable   swigconstTable;
static int             swigconstTableinit = 0;

SWIGINTERN void
SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) {
  int newobj;
  Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY);
  Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj);
}

SWIGINTERN Tcl_Obj *
SWIG_Tcl_GetConstantObj(const char *key) {
  Tcl_HashEntry *entryPtr;
  if (!swigconstTableinit) return 0;
  entryPtr = Tcl_FindHashEntry(&swigconstTable, key);
  if (entryPtr) {
    return (Tcl_Obj *) Tcl_GetHashValue(entryPtr);
  }
  return 0;
}

#ifdef __cplusplus
}
#endif



/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * tclrun.swg
 *
 * This file contains the runtime support for Tcl modules and includes
 * code for managing global variables and pointer type checking.
 * ----------------------------------------------------------------------------- */

/* Common SWIG API */

/* for raw pointers */
#define SWIG_ConvertPtr(oc, ptr, ty, flags)             SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags)
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Tcl_NewPointerObj(ptr, type, flags)

/* for raw packed data */
#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty)
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Tcl_NewPackedObj(ptr, sz, type)

/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, flags)
#define SWIG_NewInstanceObj(thisvalue, type, flags)     SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags)

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

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


/* Runtime API */

#define SWIG_GetModule(clientdata)                      SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata))          
#define SWIG_SetModule(clientdata, pointer)           SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer)


/* Error manipulation */

#define SWIG_ErrorType(code)                            SWIG_Tcl_ErrorType(code)                                      
#define SWIG_Error(code, msg)                   SWIG_Tcl_SetErrorMsg(interp, SWIG_Tcl_ErrorType(code), msg)
#define SWIG_fail                               goto fail                                     


/* Tcl-specific SWIG API */

#define SWIG_Acquire(ptr)                               SWIG_Tcl_Acquire(ptr)                                     
#define SWIG_MethodCommand                            SWIG_Tcl_MethodCommand                           
#define SWIG_Disown(ptr)                              SWIG_Tcl_Disown(ptr)                             
#define SWIG_ConvertPtrFromString(c, ptr, ty, flags)  SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags)  
#define SWIG_MakePtr(c, ptr, ty, flags)               SWIG_Tcl_MakePtr(c, ptr, ty, flags)              
#define SWIG_PointerTypeFromString(c)                 SWIG_Tcl_PointerTypeFromString(c)                      
#define SWIG_GetArgs                                  SWIG_Tcl_GetArgs                                 
#define SWIG_GetConstantObj(key)                      SWIG_Tcl_GetConstantObj(key)                     
#define SWIG_ObjectConstructor                        SWIG_Tcl_ObjectConstructor                             
#define SWIG_Thisown(ptr)                             SWIG_Tcl_Thisown(ptr)                            
#define SWIG_ObjectDelete                             SWIG_Tcl_ObjectDelete                            


#define SWIG_TCL_DECL_ARGS_2(arg1, arg2)                (Tcl_Interp *interp SWIGUNUSED, arg1, arg2)
#define SWIG_TCL_CALL_ARGS_2(arg1, arg2)                (interp, arg1, arg2)
/* -----------------------------------------------------------------------------
 * pointers/data manipulation
 * ----------------------------------------------------------------------------- */

/* For backward compatibility only */
#define SWIG_POINTER_EXCEPTION  0
#define SWIG_GetConstant        SWIG_GetConstantObj
#define SWIG_Tcl_GetConstant    SWIG_Tcl_GetConstantObj


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

/* Object support */

SWIGRUNTIME Tcl_HashTable*
SWIG_Tcl_ObjectTable(void) {
  static Tcl_HashTable  swigobjectTable;
  static int            swigobjectTableinit = 0;
  if (!swigobjectTableinit) {
    Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS);
    swigobjectTableinit = 1;
  }
  return &swigobjectTable;
}

/* Acquire ownership of a pointer */
SWIGRUNTIME void
SWIG_Tcl_Acquire(void *ptr) {
  int newobj;
  Tcl_CreateHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr, &newobj);
}

SWIGRUNTIME int
SWIG_Tcl_Thisown(void *ptr) {
  if (Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr)) {
    return 1;
  }
  return 0;
}

/* Disown a pointer.  Returns 1 if we owned it to begin with */
SWIGRUNTIME int
SWIG_Tcl_Disown(void *ptr) {
  Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr);
  if (entryPtr) {
    Tcl_DeleteHashEntry(entryPtr);
    return 1;
  }
  return 0;
}

/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) {
  swig_cast_info *tc;
  /* Pointer values must start with leading underscore */
  while (*c != '_') {
    *ptr = (void *) 0;
    if (strcmp(c,"NULL") == 0) return SWIG_OK;
    /* Hmmm. It could be an object name. */
    if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) == TCL_OK) {
      Tcl_Obj *result = Tcl_GetObjResult(interp);
      c = Tcl_GetStringFromObj(result, NULL);
      continue;
    }
    Tcl_ResetResult(interp);
    return SWIG_ERROR;
  }
  c++;
  c = SWIG_UnpackData(c,ptr,sizeof(void *));
  if (ty) {
    tc = c ? SWIG_TypeCheck(c,ty) : 0;
    if (!tc) {
      return SWIG_ERROR;
    }
    if (flags & SWIG_POINTER_DISOWN) {
      SWIG_Disown((void *) *ptr);
    }
    *ptr = SWIG_TypeCast(tc,(void *) *ptr);
  }
  return SWIG_OK;
}

/* Convert a pointer value */
SWIGRUNTIMEINLINE int
SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) {
  return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags);
}

/* Convert a pointer value */
SWIGRUNTIME char *
SWIG_Tcl_PointerTypeFromString(char *c) {
  char d;
  /* Pointer values must start with leading underscore. NULL has no type */
  if (*c != '_') {
    return 0;
  }
  c++;
  /* Extract hex value from pointer */
  while ((d = *c)) {
    if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break;
    c++;
  }
  return c;
}

/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty) {
  swig_cast_info *tc;
  const char  *c;

  if (!obj) goto type_error;
  c = Tcl_GetStringFromObj(obj,NULL);
  /* 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;
}


/* Take a pointer and convert it to a string */
SWIGRUNTIME void
SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int flags) {
  if (ptr) {
    *(c++) = '_';
    c = SWIG_PackData(c,&ptr,sizeof(void *));
    strcpy(c,ty->name);
  } else {
    strcpy(c,(char *)"NULL");
  }
  flags = 0;
}

/* Create a new pointer object */
SWIGRUNTIMEINLINE Tcl_Obj *
SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
  Tcl_Obj *robj;
  char result[SWIG_BUFFER_SIZE];
  SWIG_MakePtr(result,ptr,type,flags);
  robj = Tcl_NewStringObj(result,-1);
  return robj;
}

SWIGRUNTIME Tcl_Obj *
SWIG_Tcl_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 Tcl_NewStringObj(result,-1);
}

/* -----------------------------------------------------------------------------*
 *  Get type list 
 * -----------------------------------------------------------------------------*/

SWIGRUNTIME swig_module_info * 
SWIG_Tcl_GetModule(Tcl_Interp *interp) {
  const char *data;
  swig_module_info *ret = 0;
  
  /* first check if pointer already created */
  data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY);
  if (data) {
    SWIG_UnpackData(data, &ret, sizeof(swig_type_info **));
  }

  return ret;
}

SWIGRUNTIME void
SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) {
  char buf[SWIG_BUFFER_SIZE];
  char *data;

  /* create a new pointer */
  data = SWIG_PackData(buf, &module, sizeof(swig_type_info **));
  *data = 0;
  Tcl_SetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, 0);
}

/* -----------------------------------------------------------------------------*
 *  Object auxiliars
 * -----------------------------------------------------------------------------*/


SWIGRUNTIME void
SWIG_Tcl_ObjectDelete(ClientData clientData) {
  swig_instance *si = (swig_instance *) clientData;
  if ((si) && (si->destroy) && (SWIG_Disown(si->thisvalue))) {
    if (si->classptr->destructor) {
      (si->classptr->destructor)(si->thisvalue);
    }
  }
  Tcl_DecrRefCount(si->thisptr);
  free(si);
}

/* Function to invoke object methods given an instance */
SWIGRUNTIME int
SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) {
  char *method,   *attrname;
  swig_instance   *inst = (swig_instance *) clientData;
  swig_method     *meth;
  swig_attribute  *attr;
  Tcl_Obj         *oldarg;
  Tcl_Obj         **objv;
  int              rcode;
  swig_class      *cls;
  swig_class      *cls_stack[64];
  int              cls_stack_bi[64];
  int              cls_stack_top = 0;
  int              numconf = 2;
  int              bi;

  objv = (Tcl_Obj **) _objv;
  if (objc < 2) {
    Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
    return TCL_ERROR;
  }
  method = Tcl_GetStringFromObj(objv[1],NULL);
  if (strcmp(method,"-acquire") == 0) {
    inst->destroy = 1;
    SWIG_Acquire(inst->thisvalue);
    return TCL_OK;
  }
  if (strcmp(method,"-disown") == 0) {
    if (inst->destroy) {
      SWIG_Disown(inst->thisvalue);
    }
    inst->destroy = 0;
    return TCL_OK;
  }
  if (strcmp(method,"-delete") == 0) {
    Tcl_DeleteCommandFromToken(interp,inst->cmdtok);
    return TCL_OK;
  }
  cls_stack[cls_stack_top] = inst->classptr;
  cls_stack_bi[cls_stack_top] = -1;
  cls = inst->classptr;
  while (1) {
    bi = cls_stack_bi[cls_stack_top];
    cls = cls_stack[cls_stack_top];
    if (bi != -1) {
      if (!cls->bases[bi] && cls->base_names[bi]) {
        /* lookup and cache the base class */
      swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]);
      if (info) cls->bases[bi] = (swig_class *) info->clientdata;
      }
      cls = cls->bases[bi];
      if (cls) {
        cls_stack_bi[cls_stack_top]++;
        cls_stack_top++;
        cls_stack[cls_stack_top] = cls;
        cls_stack_bi[cls_stack_top] = -1;
        continue;
      }
    }
    if (!cls) {
      cls_stack_top--;
      if (cls_stack_top < 0) break;
      else continue;
    }
    cls_stack_bi[cls_stack_top]++;

    meth = cls->methods;
    /* Check for methods */
    while (meth && meth->name) {
      if (strcmp(meth->name,method) == 0) {
        oldarg = objv[1];
        objv[1] = inst->thisptr;
        Tcl_IncrRefCount(inst->thisptr);
        rcode = (*meth->method)(clientData,interp,objc,objv);
        objv[1] = oldarg;
        Tcl_DecrRefCount(inst->thisptr);
        return rcode;
      }
      meth++;
    }
    /* Check class methods for a match */
    if (strcmp(method,"cget") == 0) {
      if (objc < 3) {
        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
        return TCL_ERROR;
      }
      attrname = Tcl_GetStringFromObj(objv[2],NULL);
      attr = cls->attributes;
      while (attr && attr->name) {
        if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) {
          oldarg = objv[1];
          objv[1] = inst->thisptr;
          Tcl_IncrRefCount(inst->thisptr);
          rcode = (*attr->getmethod)(clientData,interp,2, objv);
          objv[1] = oldarg;
          Tcl_DecrRefCount(inst->thisptr);
          return rcode;
        }
        attr++;
      }
      if (strcmp(attrname, "-this") == 0) {
        Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr));
        return TCL_OK;
      }
      if (strcmp(attrname, "-thisown") == 0) {
        if (SWIG_Thisown(inst->thisvalue)) {
          Tcl_SetResult(interp,(char*)"1",TCL_STATIC);
        } else {
          Tcl_SetResult(interp,(char*)"0",TCL_STATIC);
        }
        return TCL_OK;
      }
    } else if (strcmp(method, "configure") == 0) {
      int i;
      if (objc < 4) {
        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
        return TCL_ERROR;
      }
      i = 2;
      while (i < objc) {
        attrname = Tcl_GetStringFromObj(objv[i],NULL);
        attr = cls->attributes;
        while (attr && attr->name) {
          if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) {
            oldarg = objv[i];
            objv[i] = inst->thisptr;
            Tcl_IncrRefCount(inst->thisptr);
            rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]);
            objv[i] = oldarg;
            Tcl_DecrRefCount(inst->thisptr);
            if (rcode != TCL_OK) return rcode;
            numconf += 2;
          }
          attr++;
        }
        i+=2;
      }
    }
  }
  if (strcmp(method,"configure") == 0) {
    if (numconf >= objc) {
      return TCL_OK;
    } else {
      Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);
      return TCL_ERROR;
    }
  }
  if (strcmp(method,"cget") == 0) {
    Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);
    return TCL_ERROR;
  }
  Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC);
  cls = inst->classptr;
  bi = 0;
  while (cls) {
    meth = cls->methods;
    while (meth && meth->name) {
      char *cr = (char *) Tcl_GetStringResult(interp);
      int meth_len = strlen(meth->name);
      char* where = strchr(cr,':');
      while(where) {
        where = strstr(where, meth->name);
        if(where) {
          if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) {
            break;
          } else {
            where++;
          }
        }
      }

      if (!where)
        Tcl_AppendElement(interp, (char *) meth->name);
      meth++;
    }
    cls = inst->classptr->bases[bi++];
  }
  return TCL_ERROR;
}

/* This function takes the current result and turns it into an object command */
SWIGRUNTIME Tcl_Obj *
SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) {
  Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0);
  /* Check to see if this pointer belongs to a class or not */
  if ((type->clientdata) && (interp)) {
    Tcl_CmdInfo    ci;
    char          *name;
    name = Tcl_GetStringFromObj(robj,NULL);
    if (!Tcl_GetCommandInfo(interp,name, &ci) || (flags)) {
      swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance));
      newinst->thisptr = Tcl_DuplicateObj(robj);
      Tcl_IncrRefCount(newinst->thisptr);
      newinst->thisvalue = thisvalue;
      newinst->classptr = (swig_class *) type->clientdata;
      newinst->destroy = flags;
      newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);
      if (flags) {
        SWIG_Acquire(thisvalue);
      }
    }
  }
  return robj;
}

/* Function to create objects */
SWIGRUNTIME int
SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj          *newObj = 0;
  void             *thisvalue = 0;
  swig_instance   *newinst = 0;
  swig_class      *classptr = (swig_class *) clientData;
  swig_wrapper     cons = 0;
  char             *name = 0;
  int               firstarg = 0;
  int               thisarg = 0;
  int               destroy = 1;

  if (!classptr) {
    Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC);
    return TCL_ERROR;
  }
  cons = classptr->constructor;
  if (objc > 1) {
    char *s = Tcl_GetStringFromObj(objv[1],NULL);
    if (strcmp(s,"-this") == 0) {
      thisarg = 2;
      cons = 0;
    } else if (strcmp(s,"-args") == 0) {
      firstarg = 1;
    } else if (objc == 2) {
      firstarg = 1;
      name = s;
    } else if (objc >= 3) {
      char *s1;
      name = s;
      s1 = Tcl_GetStringFromObj(objv[2],NULL);
      if (strcmp(s1,"-this") == 0) {
      thisarg = 3;
      cons = 0;
      } else {
      firstarg = 1;
      }
    }
  }
  if (cons) {
    int result;
    result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]);
    if (result != TCL_OK) {
      return result;
    }
    newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
    if (!name) name = Tcl_GetStringFromObj(newObj,NULL);
  } else if (thisarg > 0) {
    if (thisarg < objc) {
      destroy = 0;
      newObj = Tcl_DuplicateObj(objv[thisarg]);
      if (!name) name = Tcl_GetStringFromObj(newObj,NULL);
    } else {
      Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
      return TCL_ERROR;
    }
  } else {
    Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC);
    return TCL_ERROR;
  }
  if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), 0) != SWIG_OK) {
    Tcl_DecrRefCount(newObj);
    return TCL_ERROR;
  }
  newinst = (swig_instance *) malloc(sizeof(swig_instance));
  newinst->thisptr = newObj;
  Tcl_IncrRefCount(newObj);
  newinst->thisvalue = thisvalue;
  newinst->classptr = classptr;
  newinst->destroy = destroy;
  if (destroy) {
    SWIG_Acquire(thisvalue);
  }
  newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);
  return TCL_OK;
}

/* -----------------------------------------------------------------------------*
 *   Get arguments 
 * -----------------------------------------------------------------------------*/
SWIGRUNTIME int
SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) {
  int        argno = 0, opt = 0;
  long       tempi;
  double     tempd;
  const char *c;
  va_list    ap;
  void      *vptr;
  Tcl_Obj   *obj = 0;
  swig_type_info *ty;

  va_start(ap,fmt);
  for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) {
    if (*c == '|') {
      opt = 1;
      c++;
    }
    if (argno >= (objc-1)) {
      if (!opt) {
        Tcl_SetResult(interp, (char *) "Wrong number of arguments ", TCL_STATIC);
        goto argerror;
      } else {
        va_end(ap);
        return TCL_OK;
      }
    }

    vptr = va_arg(ap,void *);
    if (vptr) {
      if (isupper(*c)) {
        obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0));
        if (!obj) obj = objv[argno+1];
      } else {
        obj = objv[argno+1];
      }
      switch(*c) {
      case 'i': case 'I':
      case 'l': case 'L':
      case 'h': case 'H':
      case 'b': case 'B':
        if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror;
        if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi;
        else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi;
        else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi;
        else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi;
        break;
      case 'f': case 'F':
      case 'd': case 'D':
        if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror;
        if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd;
        else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd;
        break;
      case 's': case 'S':
        if (*(c+1) == '#') {
          int *vlptr = (int *) va_arg(ap, void *);
          *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr);
          c++;
        } else {
          *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL);
        }
        break;
      case 'c': case 'C':
        *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL));
        break;
      case 'p': case 'P':
        ty = (swig_type_info *) va_arg(ap, void *);
        if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, 0) != SWIG_OK) goto argerror;
        break;
      case 'o': case 'O':
        *((Tcl_Obj **)vptr) = objv[argno+1];
        break;
      default:
        break;
      }
    }
  }

  if ((*c != ';') && ((objc-1) > argno)) {
    Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC);
    goto argerror;
  }
  va_end(ap);
  return TCL_OK;

 argerror:
  {
    char temp[32];
    sprintf(temp,"%d", argno+1);
    c = strchr(fmt,':');
    if (!c) c = strchr(fmt,';');
    if (!c) c = (char *)"";
    Tcl_AppendResult(interp,c," argument ", temp, NULL);
    va_end(ap);
    return TCL_ERROR;
  }
}

#ifdef __cplusplus
#if 0
{ /* cc-mode */
#endif
}
#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); return TCL_ERROR;; } while(0) 


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

#define SWIGTYPE_p_Xapian__BM25Weight swig_types[0]
#define SWIGTYPE_p_Xapian__BoolWeight swig_types[1]
#define SWIGTYPE_p_Xapian__Database swig_types[2]
#define SWIGTYPE_p_Xapian__Document swig_types[3]
#define SWIGTYPE_p_Xapian__ESet swig_types[4]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[5]
#define SWIGTYPE_p_Xapian__Enquire swig_types[6]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[7]
#define SWIGTYPE_p_Xapian__MSet swig_types[8]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[9]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[10]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[11]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[12]
#define SWIGTYPE_p_Xapian__Query swig_types[13]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[14]
#define SWIGTYPE_p_Xapian__RSet swig_types[15]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[16]
#define SWIGTYPE_p_Xapian__Stem swig_types[17]
#define SWIGTYPE_p_Xapian__Stopper swig_types[18]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[19]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[20]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[21]
#define SWIGTYPE_p_Xapian__Weight swig_types[22]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[23]
#define SWIGTYPE_p_char swig_types[24]
#define SWIGTYPE_p_docid_order swig_types[25]
#define SWIGTYPE_p_double swig_types[26]
#define SWIGTYPE_p_feature_flag swig_types[27]
#define SWIGTYPE_p_int swig_types[28]
#define SWIGTYPE_p_stem_strategy swig_types[29]
#define SWIGTYPE_p_time_t swig_types[30]
#define SWIGTYPE_p_unsigned_int swig_types[31]
#define SWIGTYPE_std__ptrdiff_t swig_types[32]
#define SWIGTYPE_std__size_t swig_types[33]
static swig_type_info *swig_types[35];
static swig_module_info swig_module = {swig_types, 34, 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    Xapian_Init
#define SWIG_name    "xapian"
#define SWIG_prefix  "xapian::"
#define SWIG_namespace "xapian"

#define SWIG_version "0.9.9"

#define SWIGVERSION 0x010330 
#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>



#ifdef __cplusplus
extern "C" {
#endif
#ifdef MAC_TCL
#pragma export on
#endif
SWIGEXPORT int SWIG_init(Tcl_Interp *);
#ifdef MAC_TCL
#pragma export off
#endif
#ifdef __cplusplus
}
#endif



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

// Disable any deprecation warnings for Xapian methods/functions/classes.
#define XAPIAN_DEPRECATED(D) D
#include <xapian.h>
#include <string>
#include <vector>

using namespace std;

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

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

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

#ifndef XAPIAN_HAS_MUSCAT36_BACKEND
    namespace Muscat36 {
      static Database open_da(const string &, const string &, bool = true) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_da(const string &, const string &, const string &, bool = true) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_db(const string &, size_t = 30) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_db(const string &, const string &, size_t = 30) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
    }
#endif

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

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

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


#include <stdexcept>


#include <string>


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

Tcl_Obj* SwigString_FromString(std::string s) {
    return Tcl_NewStringObj(s.c_str(), s.length());
}

int Tcl_GetBoolFromObj(Tcl_Interp *interp, Tcl_Obj *o, bool *val) {
  int v;
  int res = Tcl_GetBooleanFromObj(interp, o, &v);
  if (res == TCL_OK) {
    *val = v ? true : false;
  }
  return res;  
}
 
int SwigString_AsString(Tcl_Interp *interp, Tcl_Obj *o, std::string *val) {
    int len;
    const char* temp = Tcl_GetStringFromObj(o, &len);
    if(temp == NULL)
        return TCL_ERROR;
    *val = temp;
    return TCL_OK;
}

// behaviour of this is such as the real Tcl_GetIntFromObj
template <typename Type>
int SwigInt_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) {
    int temp_val, return_val;
    return_val = Tcl_GetIntFromObj(interp, o, &temp_val);
    *val = (Type) temp_val;
    return return_val;
}

// behaviour of this is such as the real Tcl_GetDoubleFromObj
template <typename Type>
int SwigDouble_As(Tcl_Interp *interp, Tcl_Obj *o, Type *val) {
    int return_val;
    double temp_val;
    return_val = Tcl_GetDoubleFromObj(interp, o, &temp_val);
    *val = (Type) temp_val;
    return return_val;
}



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


#include <utility>


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

namespace Xapian {
    Query *get_tcl8_query(Tcl_Interp *interp, Tcl_Obj *obj) {
      Query * retval = 0;
      if (SWIG_ConvertPtr(obj, (void **)&retval,
                      SWIGTYPE_p_Xapian__Query, 0) != TCL_OK) {
          retval = 0;
      }
      return retval;
    }
}


    static int XapianTclHandleError(Tcl_Interp * interp, const Xapian::Error &e) {
      Tcl_ResetResult(interp);
      Tcl_SetErrorCode(interp, "XAPIAN", e.get_type().c_str(), NULL);
      Tcl_AppendResult(interp, e.get_msg().c_str(), NULL);
      return TCL_ERROR;
    }

    static int XapianTclHandleError(Tcl_Interp * interp, const char *e) {
      Tcl_ResetResult(interp);
      Tcl_SetErrorCode(interp, "XAPIAN", "QueryParserError", NULL);
      Tcl_AppendResult(interp, e, NULL);
      return TCL_ERROR;
    }

    static int XapianTclHandleError(Tcl_Interp * interp) {
      Tcl_ResetResult(interp);
      Tcl_SetErrorCode(interp, "XAPIAN ?", NULL);
      Tcl_AppendResult(interp, "Unknown Error", NULL);
      return TCL_ERROR;
    }


#include <limits.h>
#ifndef LLONG_MIN
# define LLONG_MIN      LONG_LONG_MIN
#endif
#ifndef LLONG_MAX
# define LLONG_MAX      LONG_LONG_MAX
#endif
#ifndef ULLONG_MAX
# define ULLONG_MAX     ULONG_LONG_MAX
#endif


SWIGINTERNINLINE Tcl_Obj *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
  return (size < INT_MAX) ? Tcl_NewStringObj(carray, static_cast< int >(size)) : NULL;
}


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


SWIGINTERNINLINE Tcl_Obj* 
SWIG_From_long  (long value)
{
  if (((long) INT_MIN <= value) && (value <= (long) INT_MAX)) {
    return Tcl_NewIntObj(static_cast< int >(value));
  } else {
    return Tcl_NewLongObj(value);
  }
}


SWIGINTERNINLINE Tcl_Obj *
SWIG_From_int  (int value)
{    
  return SWIG_From_long  (value);
}

SWIGINTERN Xapian::termpos Xapian_PositionIterator_get_termpos(Xapian::PositionIterator const *self){
          return *(*self);
      }

#include <stdio.h>
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# ifndef snprintf
#  define snprintf _snprintf
# endif
#endif


SWIGINTERNINLINE Tcl_Obj* 
SWIG_From_unsigned_SS_long  (unsigned long value)
{
  if (value < (unsigned long) LONG_MAX) {
    return SWIG_From_long  (static_cast< long >(value));
  } else {
    char temp[256]; 
    sprintf(temp, "%lu", value);
    return Tcl_NewStringObj(temp,-1);
  }
}


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

SWIGINTERN void Xapian_PositionIterator_next(Xapian::PositionIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PositionIterator_equals(Xapian::PositionIterator const *self,Xapian::PositionIterator const &other){
          return (*self) == other;
      }

  #define SWIG_From_bool   Tcl_NewBooleanObj 


SWIGINTERN int
SWIG_AsVal_unsigned_SS_long SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, unsigned long *val) {
  long v;
  if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) {
    if (v >= 0) {
      if (val) *val = (unsigned long) v;
      return SWIG_OK;
    }
    /* If v is negative, then this could be a negative number, or an
       unsigned value which doesn't fit in a signed long, so try to
       get it as a string so we can distinguish these cases. */
  }
  {
    int len = 0;
    const char *nptr = Tcl_GetStringFromObj(obj, &len);
    if (nptr && len > 0) {
      char *endptr;
      unsigned long v;
      if (*nptr == '-') return SWIG_OverflowError;
      v = strtoul(nptr, &endptr,0);
      if (errno == ERANGE) {
      errno = 0;
      return SWIG_OverflowError;
      } else {
      if (*endptr == '\0') {
        if (val) *val = v;
        return SWIG_OK;
      }
      }
    }
  }
  
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_unsigned_SS_int SWIG_TCL_DECL_ARGS_2(Tcl_Obj * obj, unsigned int *val)
{
  unsigned long v;
  int res = SWIG_AsVal_unsigned_SS_long SWIG_TCL_CALL_ARGS_2(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 Tcl_Obj *
SWIG_From_std_string  (const std::string& s)
{
  if (s.size()) {
    return SWIG_FromCharPtrAndSize(s.data(), s.size());
  } else {
    return SWIG_FromCharPtrAndSize(s.c_str(), 0);
  }
}

SWIGINTERN Xapian::docid Xapian_PostingIterator_get_docid(Xapian::PostingIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_PostingIterator_next(Xapian::PostingIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &other){
          return (*self) == other;
      }

  #define SWIG_From_double   Tcl_NewDoubleObj 

SWIGINTERN std::string Xapian_TermIterator_get_term(Xapian::TermIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_TermIterator_next(Xapian::TermIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &other){
          return (*self) == other;
      }

SWIGINTERN int
SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc)
{ 
  int len = 0;
  char *cstr = Tcl_GetStringFromObj(obj, &len);
  if (cstr) {
    if (cptr)  *cptr = cstr;
    if (psize) *psize = len + 1;
    if (alloc) *alloc = SWIG_OLDOBJ;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsPtr_std_string SWIG_TCL_DECL_ARGS_2(Tcl_Obj * 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 std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &other){
          return (*self) == other;
      }

SWIGINTERN int
SWIG_AsVal_double SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, double *val)
{
  double v;
  if (Tcl_GetDoubleFromObj(0, obj, &v) == TCL_OK) {
    if (val) *val = v;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}

SWIGINTERN bool Xapian_MSet_is_empty(Xapian::MSet const *self){ return self->empty(); }
SWIGINTERN Xapian::MSetIterator Xapian_MSet_get_hit(Xapian::MSet const *self,Xapian::doccount i){
          return ((*self)[i]);
      }
SWIGINTERN int Xapian_MSet_get_document_percentage(Xapian::MSet const *self,Xapian::doccount i){
          return (*self).convert_to_percent( ((*self)[i]) );
      }
SWIGINTERN Xapian::Document const Xapian_MSet_get_document(Xapian::MSet const *self,Xapian::doccount i){
          return ((*self)[i]).get_document();
      }
SWIGINTERN Xapian::docid Xapian_MSet_get_docid(Xapian::MSet const *self,Xapian::doccount i){
          return *((*self)[i]);
      }
SWIGINTERN Xapian::docid Xapian_MSet_get_document_id(Xapian::MSet const *self,Xapian::doccount i){
          return *((*self)[i]);
      }
SWIGINTERN Xapian::docid Xapian_MSetIterator_get_docid(Xapian::MSetIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_MSetIterator_next(Xapian::MSetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_MSetIterator_prev(Xapian::MSetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &other){
          return (*self) == other;
      }
SWIGINTERN bool Xapian_ESet_is_empty(Xapian::ESet const *self){ return self->empty(); }
SWIGINTERN std::string Xapian_ESetIterator_get_termname(Xapian::ESetIterator const *self){
          return *(*self);
      }
SWIGINTERN void Xapian_ESetIterator_next(Xapian::ESetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_ESetIterator_prev(Xapian::ESetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_ESetIterator_equals(Xapian::ESetIterator const *self,Xapian::ESetIterator const &other){
          return (*self) == other;
      }
SWIGINTERN bool Xapian_RSet_is_empty(Xapian::RSet const *self){ return self->empty(); }

SWIGINTERN int
SWIG_AsVal_long SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, long* val)
{
  long v;
  if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) {
    if (val) *val = (long) v;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_int SWIG_TCL_DECL_ARGS_2(Tcl_Obj * obj, int *val)
{
  long v;
  int res = SWIG_AsVal_long SWIG_TCL_CALL_ARGS_2(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;
}


SWIGINTERN int
SWIG_AsVal_bool SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, bool *val)
{
  int v;
  if (Tcl_GetBooleanFromObj(0, obj, &v) == TCL_OK) {
    if (val) *val = v ? true : false;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}

SWIGINTERN std::pair<Xapian::TermIterator,Xapian::TermIterator > Xapian_Enquire_get_matching_terms(Xapian::Enquire const *self,Xapian::MSetIterator const &hit){
          return make_pair(self->get_matching_terms_begin(hit),
                       self->get_matching_terms_end(hit));
      }

SWIGINTERNINLINE int
SWIG_AsVal_size_t SWIG_TCL_DECL_ARGS_2(Tcl_Obj * obj, size_t *val)
{
  unsigned long v;
  int res = SWIG_AsVal_unsigned_SS_long SWIG_TCL_CALL_ARGS_2(obj, val ? &v : 0);
  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
  return res;
}

SWIGINTERN Xapian::Query *new_Xapian_Query__SWIG_6(Xapian::Query::op op,std::vector<Xapian::Query > const &subqs,Xapian::termcount param=0){
            return new Xapian::Query(op, subqs.begin(), subqs.end(), param);
          }
#ifdef __cplusplus
extern "C" {
#endif
SWIGINTERN int
_wrap_version_string(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  char *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::version_string ") == TCL_ERROR) SWIG_fail;
  result = (char *)Xapian::version_string();
  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_major_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::major_version ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::major_version();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_minor_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::minor_version ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::minor_version();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_revision(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::revision ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::revision();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_xapian_version_string(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  char *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::xapian_version_string ") == TCL_ERROR) SWIG_fail;
  result = (char *)Xapian::xapian_version_string();
  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_xapian_major_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::xapian_major_version ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::xapian_major_version();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_xapian_minor_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::xapian_minor_version ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::xapian_minor_version();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_xapian_revision(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  int result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::xapian_revision ") == TCL_ERROR) SWIG_fail;
  result = (int)Xapian::xapian_revision();
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_PositionIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_PositionIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PositionIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_PositionIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_PositionIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__PositionIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PositionIterator" "', argument " "1"" of type '" "Xapian::PositionIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_PositionIterator" "', argument " "1"" of type '" "Xapian::PositionIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator((Xapian::PositionIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PositionIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_PositionIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_PositionIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__PositionIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_PositionIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_PositionIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_PositionIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_PositionIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PositionIterator" "', argument " "1"" of type '" "Xapian::PositionIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PositionIterator_get_termpos(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PositionIterator_get_termpos self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PositionIterator_get_termpos" "', argument " "1"" of type '" "Xapian::PositionIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      result = (Xapian::termpos)Xapian_PositionIterator_get_termpos((Xapian::PositionIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PositionIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PositionIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PositionIterator_next" "', argument " "1"" of type '" "Xapian::PositionIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PositionIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::PositionIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PositionIterator_equals" "', argument " "1"" of type '" "Xapian::PositionIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__PositionIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PositionIterator_equals" "', argument " "2"" of type '" "Xapian::PositionIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PositionIterator_equals" "', argument " "2"" of type '" "Xapian::PositionIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::PositionIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PositionIterator_skip_to(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::PositionIterator_skip_to self pos ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PositionIterator_skip_to" "', argument " "1"" of type '" "Xapian::PositionIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PositionIterator_skip_to" "', argument " "2"" of type '" "Xapian::termpos""'");
  } 
  arg2 = static_cast< Xapian::termpos >(val2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PositionIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PositionIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PositionIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PositionIterator_get_description" "', argument " "1"" of type '" "Xapian::PositionIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PositionIterator * >(argp1);
  {
    try {
      result = ((Xapian::PositionIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_PositionIterator(void *obj) {
Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_PositionIterator_methods[] = {
    {"get_termpos", _wrap_PositionIterator_get_termpos}, 
    {"next", _wrap_PositionIterator_next}, 
    {"equals", _wrap_PositionIterator_equals}, 
    {"skip_to", _wrap_PositionIterator_skip_to}, 
    {"get_description", _wrap_PositionIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_PositionIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_PositionIterator_bases[] = {0};
static char *swig_Xapian_PositionIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_PositionIterator = { "PositionIterator", &SWIGTYPE_p_Xapian__PositionIterator,_wrap_new_PositionIterator, swig_delete_PositionIterator, swig_Xapian_PositionIterator_methods, swig_Xapian_PositionIterator_attributes, swig_Xapian_PositionIterator_bases,swig_Xapian_PositionIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_PostingIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_PostingIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PostingIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_PostingIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_PostingIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__PostingIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PostingIterator" "', argument " "1"" of type '" "Xapian::PostingIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_PostingIterator" "', argument " "1"" of type '" "Xapian::PostingIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator((Xapian::PostingIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__PostingIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_PostingIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_PostingIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__PostingIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_PostingIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_PostingIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_PostingIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_PostingIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PostingIterator" "', argument " "1"" of type '" "Xapian::PostingIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_get_docid(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_get_docid self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_get_docid" "', argument " "1"" of type '" "Xapian::PostingIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::docid)Xapian_PostingIterator_get_docid((Xapian::PostingIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_next" "', argument " "1"" of type '" "Xapian::PostingIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::PostingIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_equals" "', argument " "1"" of type '" "Xapian::PostingIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__PostingIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PostingIterator_equals" "', argument " "2"" of type '" "Xapian::PostingIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PostingIterator_equals" "', argument " "2"" of type '" "Xapian::PostingIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::PostingIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_skip_to(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::PostingIterator_skip_to self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_skip_to" "', argument " "1"" of type '" "Xapian::PostingIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PostingIterator_skip_to" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_get_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::doclength result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_get_doclength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_get_doclength" "', argument " "1"" of type '" "Xapian::PostingIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::doclength)((Xapian::PostingIterator const *)arg1)->get_doclength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_get_wdf(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_get_wdf self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_get_wdf" "', argument " "1"" of type '" "Xapian::PostingIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_wdf();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_positionlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_positionlist_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_positionlist_begin" "', argument " "1"" of type '" "Xapian::PostingIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_positionlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_positionlist_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_positionlist_end" "', argument " "1"" of type '" "Xapian::PostingIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_PostingIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::PostingIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__PostingIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PostingIterator_get_description" "', argument " "1"" of type '" "Xapian::PostingIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::PostingIterator * >(argp1);
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_PostingIterator(void *obj) {
Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_PostingIterator_methods[] = {
    {"get_docid", _wrap_PostingIterator_get_docid}, 
    {"next", _wrap_PostingIterator_next}, 
    {"equals", _wrap_PostingIterator_equals}, 
    {"skip_to", _wrap_PostingIterator_skip_to}, 
    {"get_doclength", _wrap_PostingIterator_get_doclength}, 
    {"get_wdf", _wrap_PostingIterator_get_wdf}, 
    {"positionlist_begin", _wrap_PostingIterator_positionlist_begin}, 
    {"positionlist_end", _wrap_PostingIterator_positionlist_end}, 
    {"get_description", _wrap_PostingIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_PostingIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_PostingIterator_bases[] = {0};
static char *swig_Xapian_PostingIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_PostingIterator = { "PostingIterator", &SWIGTYPE_p_Xapian__PostingIterator,_wrap_new_PostingIterator, swig_delete_PostingIterator, swig_Xapian_PostingIterator_methods, swig_Xapian_PostingIterator_attributes, swig_Xapian_PostingIterator_bases,swig_Xapian_PostingIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_TermIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_TermIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TermIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_TermIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_TermIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__TermIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_TermIterator" "', argument " "1"" of type '" "Xapian::TermIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_TermIterator" "', argument " "1"" of type '" "Xapian::TermIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator((Xapian::TermIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TermIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_TermIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_TermIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__TermIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_TermIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_TermIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_TermIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_TermIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_TermIterator" "', argument " "1"" of type '" "Xapian::TermIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_get_term(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_get_term self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_get_term" "', argument " "1"" of type '" "Xapian::TermIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = Xapian_TermIterator_get_term((Xapian::TermIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_next" "', argument " "1"" of type '" "Xapian::TermIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::TermIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_equals" "', argument " "1"" of type '" "Xapian::TermIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__TermIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TermIterator_equals" "', argument " "2"" of type '" "Xapian::TermIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TermIterator_equals" "', argument " "2"" of type '" "Xapian::TermIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::TermIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_skip_to(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::TermIterator_skip_to self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_skip_to" "', argument " "1"" of type '" "Xapian::TermIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TermIterator_skip_to" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TermIterator_skip_to" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_get_wdf(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_get_wdf self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_get_wdf" "', argument " "1"" of type '" "Xapian::TermIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->get_wdf();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_get_termfreq(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_get_termfreq self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_get_termfreq" "', argument " "1"" of type '" "Xapian::TermIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::TermIterator const *)arg1)->get_termfreq();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_positionlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_positionlist_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_positionlist_begin" "', argument " "1"" of type '" "Xapian::TermIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_positionlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_positionlist_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_positionlist_end" "', argument " "1"" of type '" "Xapian::TermIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TermIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TermIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TermIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TermIterator_get_description" "', argument " "1"" of type '" "Xapian::TermIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TermIterator * >(argp1);
  {
    try {
      result = ((Xapian::TermIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_TermIterator(void *obj) {
Xapian::TermIterator *arg1 = (Xapian::TermIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_TermIterator_methods[] = {
    {"get_term", _wrap_TermIterator_get_term}, 
    {"next", _wrap_TermIterator_next}, 
    {"equals", _wrap_TermIterator_equals}, 
    {"skip_to", _wrap_TermIterator_skip_to}, 
    {"get_wdf", _wrap_TermIterator_get_wdf}, 
    {"get_termfreq", _wrap_TermIterator_get_termfreq}, 
    {"positionlist_begin", _wrap_TermIterator_positionlist_begin}, 
    {"positionlist_end", _wrap_TermIterator_positionlist_end}, 
    {"get_description", _wrap_TermIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_TermIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_TermIterator_bases[] = {0};
static char *swig_Xapian_TermIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_TermIterator = { "TermIterator", &SWIGTYPE_p_Xapian__TermIterator,_wrap_new_TermIterator, swig_delete_TermIterator, swig_Xapian_TermIterator_methods, swig_Xapian_TermIterator_attributes, swig_Xapian_TermIterator_bases,swig_Xapian_TermIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_ValueIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_ValueIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ValueIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ValueIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_ValueIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__ValueIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ValueIterator" "', argument " "1"" of type '" "Xapian::ValueIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ValueIterator" "', argument " "1"" of type '" "Xapian::ValueIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator((Xapian::ValueIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ValueIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ValueIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_ValueIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ValueIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_ValueIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_ValueIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_ValueIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_ValueIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ValueIterator" "', argument " "1"" of type '" "Xapian::ValueIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ValueIterator_get_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ValueIterator_get_value self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ValueIterator_get_value" "', argument " "1"" of type '" "Xapian::ValueIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = Xapian_ValueIterator_get_value((Xapian::ValueIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ValueIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ValueIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ValueIterator_next" "', argument " "1"" of type '" "Xapian::ValueIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ValueIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::ValueIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ValueIterator_equals" "', argument " "1"" of type '" "Xapian::ValueIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__ValueIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ValueIterator_equals" "', argument " "2"" of type '" "Xapian::ValueIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ValueIterator_equals" "', argument " "2"" of type '" "Xapian::ValueIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::ValueIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ValueIterator_get_valueno(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::valueno result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ValueIterator_get_valueno self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ValueIterator_get_valueno" "', argument " "1"" of type '" "Xapian::ValueIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = (Xapian::valueno)(arg1)->get_valueno();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ValueIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ValueIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ValueIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ValueIterator_get_description" "', argument " "1"" of type '" "Xapian::ValueIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ValueIterator * >(argp1);
  {
    try {
      result = ((Xapian::ValueIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_ValueIterator(void *obj) {
Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_ValueIterator_methods[] = {
    {"get_value", _wrap_ValueIterator_get_value}, 
    {"next", _wrap_ValueIterator_next}, 
    {"equals", _wrap_ValueIterator_equals}, 
    {"get_valueno", _wrap_ValueIterator_get_valueno}, 
    {"get_description", _wrap_ValueIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_ValueIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_ValueIterator_bases[] = {0};
static char *swig_Xapian_ValueIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_ValueIterator = { "ValueIterator", &SWIGTYPE_p_Xapian__ValueIterator,_wrap_new_ValueIterator, swig_delete_ValueIterator, swig_Xapian_ValueIterator_methods, swig_Xapian_ValueIterator_attributes, swig_Xapian_ValueIterator_bases,swig_Xapian_ValueIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_Document__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_Document ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::Document *)new Xapian::Document();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Document,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Document__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = 0 ;
  Xapian::Document *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_Document other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Document" "', argument " "1"" of type '" "Xapian::Document const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Document" "', argument " "1"" of type '" "Xapian::Document const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::Document *)new Xapian::Document((Xapian::Document const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Document,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_Document__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__Document, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Document__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_Document'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_Document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_Document self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Document" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_get_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_get_value self valueno ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_get_value" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_get_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_value(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Document_add_value self valueno value ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_value" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_add_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[3], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_add_value" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_value" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    arg3 = ptr;
  }
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_remove_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_remove_value self valueno ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_remove_value" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_remove_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->remove_value(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_clear_values(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_clear_values self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_clear_values" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      (arg1)->clear_values();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_get_data(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_get_data self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_get_data" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_data();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_set_data(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_set_data self data ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_set_data" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_set_data" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_set_data" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_posting__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Document_add_posting self tname tpos wdfinc ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_posting" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_add_posting" "', argument " "3"" of type '" "Xapian::termpos""'");
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_add_posting" "', argument " "4"" of type '" "Xapian::termcount""'");
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_posting__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Document_add_posting self tname tpos ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_posting" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_add_posting" "', argument " "3"" of type '" "Xapian::termpos""'");
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_posting(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_add_posting__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Document_add_posting__SWIG_0(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Document_add_posting'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Document_add_term self tname wdfinc ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_term" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_add_term" "', argument " "3"" of type '" "Xapian::termcount""'");
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_add_term self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_term" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Document_add_term__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_add_term__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Document_add_term'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term_nopos__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Document_add_term_nopos self tname wdfinc ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_term_nopos" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_term_nopos" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_term_nopos" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_add_term_nopos" "', argument " "3"" of type '" "Xapian::termcount""'");
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->add_term_nopos((std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term_nopos__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_add_term_nopos self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_add_term_nopos" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_add_term_nopos" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_add_term_nopos" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->add_term_nopos((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_add_term_nopos(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Document_add_term_nopos__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_add_term_nopos__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Document_add_term_nopos'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_remove_posting__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Document_remove_posting self tname tpos wdfdec ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_remove_posting" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_remove_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_remove_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_remove_posting" "', argument " "3"" of type '" "Xapian::termpos""'");
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_remove_posting" "', argument " "4"" of type '" "Xapian::termcount""'");
  } 
  arg4 = static_cast< Xapian::termcount >(val4);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_remove_posting__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Document_remove_posting self tname tpos ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_remove_posting" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_remove_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_remove_posting" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_remove_posting" "', argument " "3"" of type '" "Xapian::termpos""'");
  } 
  arg3 = static_cast< Xapian::termpos >(val3);
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_remove_posting(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Document_remove_posting__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Document_remove_posting__SWIG_0(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Document_remove_posting'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_remove_term(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Document_remove_term self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_remove_term" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_remove_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_remove_term" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_clear_terms(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_clear_terms self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_clear_terms" "', argument " "1"" of type '" "Xapian::Document *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      (arg1)->clear_terms();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_termlist_count(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_termlist_count self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_termlist_count" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->termlist_count();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_termlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_termlist_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_termlist_begin" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_termlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_termlist_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_termlist_end" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_values_count(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_values_count self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_values_count" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->values_count();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_values_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_values_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_values_begin" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_values_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_values_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_values_end" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ValueIterator(static_cast< const Xapian::ValueIterator& >(result))), SWIGTYPE_p_Xapian__ValueIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Document_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Document_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Document, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_get_description" "', argument " "1"" of type '" "Xapian::Document const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Document * >(argp1);
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_Document(void *obj) {
Xapian::Document *arg1 = (Xapian::Document *) obj;
delete arg1;
}
static swig_method swig_Xapian_Document_methods[] = {
    {"get_value", _wrap_Document_get_value}, 
    {"add_value", _wrap_Document_add_value}, 
    {"remove_value", _wrap_Document_remove_value}, 
    {"clear_values", _wrap_Document_clear_values}, 
    {"get_data", _wrap_Document_get_data}, 
    {"set_data", _wrap_Document_set_data}, 
    {"add_posting", _wrap_Document_add_posting}, 
    {"add_term", _wrap_Document_add_term}, 
    {"add_term_nopos", _wrap_Document_add_term_nopos}, 
    {"remove_posting", _wrap_Document_remove_posting}, 
    {"remove_term", _wrap_Document_remove_term}, 
    {"clear_terms", _wrap_Document_clear_terms}, 
    {"termlist_count", _wrap_Document_termlist_count}, 
    {"termlist_begin", _wrap_Document_termlist_begin}, 
    {"termlist_end", _wrap_Document_termlist_end}, 
    {"values_count", _wrap_Document_values_count}, 
    {"values_begin", _wrap_Document_values_begin}, 
    {"values_end", _wrap_Document_values_end}, 
    {"get_description", _wrap_Document_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_Document_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_Document_bases[] = {0};
static char *swig_Xapian_Document_base_names[] = {0};
static swig_class _wrap_class_Xapian_Document = { "Document", &SWIGTYPE_p_Xapian__Document,_wrap_new_Document, swig_delete_Document, swig_Xapian_Document_methods, swig_Xapian_Document_attributes, swig_Xapian_Document_bases,swig_Xapian_Document_base_names, &swig_module };
SWIGINTERN int
_wrap_new_MSet__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_MSet ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MSet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_MSet__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = 0 ;
  Xapian::MSet *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_MSet other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__MSet,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MSet" "', argument " "1"" of type '" "Xapian::MSet const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MSet" "', argument " "1"" of type '" "Xapian::MSet const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet((Xapian::MSet const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MSet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_MSet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_MSet__SWIG_0(clientData, interp, objc, argv - 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_new_MSet__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_MSet'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_MSet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_MSet self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MSet" "', argument " "1"" of type '" "Xapian::MSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_fetch__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::MSet_fetch self begin end ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_fetch" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MSet_fetch" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MSet_fetch" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MSet_fetch" "', argument " "3"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MSet_fetch" "', argument " "3"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::MSetIterator * >(argp3);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2,*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_fetch__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_fetch self item ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_fetch" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MSet_fetch" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MSet_fetch" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_fetch__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_fetch self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_fetch" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_fetch(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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_fetch__SWIG_1(clientData, interp, objc, argv - 1);
      }
    }
  }
  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(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'MSet_fetch'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_convert_to_percent__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight arg2 ;
  Xapian::percent result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_convert_to_percent self wt ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_convert_to_percent" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_convert_to_percent" "', argument " "2"" of type '" "Xapian::weight""'");
  } 
  arg2 = static_cast< Xapian::weight >(val2);
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_convert_to_percent__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::percent result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_convert_to_percent self item ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_convert_to_percent" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MSet_convert_to_percent" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MSet_convert_to_percent" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_convert_to_percent(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MSet_convert_to_percent__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'MSet_convert_to_percent'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_termfreq(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_termfreq self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_termfreq" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res) || !ptr) {
      SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "MSet_get_termfreq" "', argument " "2"" of type '" "std::string""'"); 
    }
    arg2 = *ptr;
    if (SWIG_IsNewObj(res)) delete ptr;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_termfreq(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_termweight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_termweight self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_termweight" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res) || !ptr) {
      SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "MSet_get_termweight" "', argument " "2"" of type '" "std::string""'"); 
    }
    arg2 = *ptr;
    if (SWIG_IsNewObj(res)) delete ptr;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::MSet const *)arg1)->get_termweight(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_firstitem(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_firstitem self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_firstitem" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_firstitem();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_matches_lower_bound(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_matches_lower_bound self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_matches_lower_bound" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_lower_bound();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_matches_estimated(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_matches_estimated self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_matches_estimated" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_estimated();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_matches_upper_bound(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_matches_upper_bound self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_matches_upper_bound" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_upper_bound();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_max_possible(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_max_possible self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_max_possible" "', argument " "1"" of type '" "Xapian::MSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_possible();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_max_attained(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_max_attained self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_max_attained" "', argument " "1"" of type '" "Xapian::MSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_attained();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_size(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_size self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_size" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->size();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_empty" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (bool)((Xapian::MSet const *)arg1)->empty();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_is_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_is_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_is_empty" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = (bool)Xapian_MSet_is_empty((Xapian::MSet const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_begin" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_end" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_back(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_back self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_back" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->back();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_hit(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::MSetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_hit self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_hit" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_get_hit" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = Xapian_MSet_get_hit((Xapian::MSet const *)arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSetIterator(static_cast< const Xapian::MSetIterator& >(result))), SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_document_percentage(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  int result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_document_percentage self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_document_percentage" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_get_document_percentage" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = (int)Xapian_MSet_get_document_percentage((Xapian::MSet const *)arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::Document result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_document self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_document" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_get_document" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = Xapian_MSet_get_document((Xapian::MSet const *)arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_docid(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_docid self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_docid" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_get_docid" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_docid((Xapian::MSet const *)arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_document_id(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSet_get_document_id self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_document_id" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MSet_get_document_id" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_document_id((Xapian::MSet const *)arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSet_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSet_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSet_get_description" "', argument " "1"" of type '" "Xapian::MSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSet * >(argp1);
  {
    try {
      result = ((Xapian::MSet const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_MSet(void *obj) {
Xapian::MSet *arg1 = (Xapian::MSet *) obj;
delete arg1;
}
static swig_method swig_Xapian_MSet_methods[] = {
    {"fetch", _wrap_MSet_fetch}, 
    {"convert_to_percent", _wrap_MSet_convert_to_percent}, 
    {"get_termfreq", _wrap_MSet_get_termfreq}, 
    {"get_termweight", _wrap_MSet_get_termweight}, 
    {"get_firstitem", _wrap_MSet_get_firstitem}, 
    {"get_matches_lower_bound", _wrap_MSet_get_matches_lower_bound}, 
    {"get_matches_estimated", _wrap_MSet_get_matches_estimated}, 
    {"get_matches_upper_bound", _wrap_MSet_get_matches_upper_bound}, 
    {"get_max_possible", _wrap_MSet_get_max_possible}, 
    {"get_max_attained", _wrap_MSet_get_max_attained}, 
    {"size", _wrap_MSet_size}, 
    {"empty", _wrap_MSet_empty}, 
    {"is_empty", _wrap_MSet_is_empty}, 
    {"begin", _wrap_MSet_begin}, 
    {"end", _wrap_MSet_end}, 
    {"back", _wrap_MSet_back}, 
    {"get_hit", _wrap_MSet_get_hit}, 
    {"get_document_percentage", _wrap_MSet_get_document_percentage}, 
    {"get_document", _wrap_MSet_get_document}, 
    {"get_docid", _wrap_MSet_get_docid}, 
    {"get_document_id", _wrap_MSet_get_document_id}, 
    {"get_description", _wrap_MSet_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_MSet_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_MSet_bases[] = {0};
static char *swig_Xapian_MSet_base_names[] = {0};
static swig_class _wrap_class_Xapian_MSet = { "MSet", &SWIGTYPE_p_Xapian__MSet,_wrap_new_MSet, swig_delete_MSet, swig_Xapian_MSet_methods, swig_Xapian_MSet_attributes, swig_Xapian_MSet_bases,swig_Xapian_MSet_base_names, &swig_module };
SWIGINTERN int
_wrap_new_MSetIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_MSetIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MSetIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_MSetIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_MSetIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MSetIterator" "', argument " "1"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MSetIterator" "', argument " "1"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator((Xapian::MSetIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__MSetIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_MSetIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_MSetIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__MSetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_MSetIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_MSetIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_MSetIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_MSetIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MSetIterator" "', argument " "1"" of type '" "Xapian::MSetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_docid(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_docid self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_docid" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::docid)Xapian_MSetIterator_get_docid((Xapian::MSetIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_next" "', argument " "1"" of type '" "Xapian::MSetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_prev(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_prev self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_prev" "', argument " "1"" of type '" "Xapian::MSetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::MSetIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_equals" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MSetIterator_equals" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MSetIterator_equals" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::Document result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_document self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_document" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_document();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_rank(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_rank self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_rank" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_rank();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_weight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_weight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_weight" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::MSetIterator const *)arg1)->get_weight();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_collapse_count(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_collapse_count self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_collapse_count" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_collapse_count();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_percent(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::percent result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_percent self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_percent" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = (Xapian::percent)((Xapian::MSetIterator const *)arg1)->get_percent();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_int(static_cast< int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_MSetIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::MSetIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__MSetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MSetIterator_get_description" "', argument " "1"" of type '" "Xapian::MSetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::MSetIterator * >(argp1);
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_MSetIterator(void *obj) {
Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_MSetIterator_methods[] = {
    {"get_docid", _wrap_MSetIterator_get_docid}, 
    {"next", _wrap_MSetIterator_next}, 
    {"prev", _wrap_MSetIterator_prev}, 
    {"equals", _wrap_MSetIterator_equals}, 
    {"get_document", _wrap_MSetIterator_get_document}, 
    {"get_rank", _wrap_MSetIterator_get_rank}, 
    {"get_weight", _wrap_MSetIterator_get_weight}, 
    {"get_collapse_count", _wrap_MSetIterator_get_collapse_count}, 
    {"get_percent", _wrap_MSetIterator_get_percent}, 
    {"get_description", _wrap_MSetIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_MSetIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_MSetIterator_bases[] = {0};
static char *swig_Xapian_MSetIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_MSetIterator = { "MSetIterator", &SWIGTYPE_p_Xapian__MSetIterator,_wrap_new_MSetIterator, swig_delete_MSetIterator, swig_Xapian_MSetIterator_methods, swig_Xapian_MSetIterator_attributes, swig_Xapian_MSetIterator_bases,swig_Xapian_MSetIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_ESet__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_ESet ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ESet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ESet__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = 0 ;
  Xapian::ESet *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_ESet other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__ESet,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESet" "', argument " "1"" of type '" "Xapian::ESet const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ESet" "', argument " "1"" of type '" "Xapian::ESet const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet((Xapian::ESet const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ESet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ESet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_ESet__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_ESet__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_ESet'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_ESet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_ESet self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ESet" "', argument " "1"" of type '" "Xapian::ESet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_get_ebound(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_get_ebound self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_get_ebound" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->get_ebound();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_size(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_size self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_size" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->size();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_empty" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (bool)((Xapian::ESet const *)arg1)->empty();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_is_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_is_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_is_empty" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = (bool)Xapian_ESet_is_empty((Xapian::ESet const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_begin" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_end" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_back(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_back self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_back" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->back();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESetIterator(static_cast< const Xapian::ESetIterator& >(result))), SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESet_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESet_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESet_get_description" "', argument " "1"" of type '" "Xapian::ESet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESet * >(argp1);
  {
    try {
      result = ((Xapian::ESet const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_ESet(void *obj) {
Xapian::ESet *arg1 = (Xapian::ESet *) obj;
delete arg1;
}
static swig_method swig_Xapian_ESet_methods[] = {
    {"get_ebound", _wrap_ESet_get_ebound}, 
    {"size", _wrap_ESet_size}, 
    {"empty", _wrap_ESet_empty}, 
    {"is_empty", _wrap_ESet_is_empty}, 
    {"begin", _wrap_ESet_begin}, 
    {"end", _wrap_ESet_end}, 
    {"back", _wrap_ESet_back}, 
    {"get_description", _wrap_ESet_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_ESet_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_ESet_bases[] = {0};
static char *swig_Xapian_ESet_base_names[] = {0};
static swig_class _wrap_class_Xapian_ESet = { "ESet", &SWIGTYPE_p_Xapian__ESet,_wrap_new_ESet, swig_delete_ESet, swig_Xapian_ESet_methods, swig_Xapian_ESet_attributes, swig_Xapian_ESet_bases,swig_Xapian_ESet_base_names, &swig_module };
SWIGINTERN int
_wrap_new_ESetIterator__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_ESetIterator ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ESetIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ESetIterator__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_ESetIterator other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESetIterator" "', argument " "1"" of type '" "Xapian::ESetIterator const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ESetIterator" "', argument " "1"" of type '" "Xapian::ESetIterator const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator((Xapian::ESetIterator const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__ESetIterator,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_ESetIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_ESetIterator__SWIG_0(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__ESetIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_ESetIterator__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_ESetIterator'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_ESetIterator(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_ESetIterator self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ESetIterator" "', argument " "1"" of type '" "Xapian::ESetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_get_termname(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESetIterator_get_termname self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_get_termname" "', argument " "1"" of type '" "Xapian::ESetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = Xapian_ESetIterator_get_termname((Xapian::ESetIterator const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_next(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESetIterator_next self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_next" "', argument " "1"" of type '" "Xapian::ESetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_prev(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESetIterator_prev self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_prev" "', argument " "1"" of type '" "Xapian::ESetIterator *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_equals(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::ESetIterator_equals self other ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_equals" "', argument " "1"" of type '" "Xapian::ESetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__ESetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESetIterator_equals" "', argument " "2"" of type '" "Xapian::ESetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ESetIterator_equals" "', argument " "2"" of type '" "Xapian::ESetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::ESetIterator * >(argp2);
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_get_weight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESetIterator_get_weight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_get_weight" "', argument " "1"" of type '" "Xapian::ESetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::ESetIterator const *)arg1)->get_weight();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_ESetIterator_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::ESetIterator_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__ESetIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESetIterator_get_description" "', argument " "1"" of type '" "Xapian::ESetIterator const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::ESetIterator * >(argp1);
  {
    try {
      result = ((Xapian::ESetIterator const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_ESetIterator(void *obj) {
Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) obj;
delete arg1;
}
static swig_method swig_Xapian_ESetIterator_methods[] = {
    {"get_termname", _wrap_ESetIterator_get_termname}, 
    {"next", _wrap_ESetIterator_next}, 
    {"prev", _wrap_ESetIterator_prev}, 
    {"equals", _wrap_ESetIterator_equals}, 
    {"get_weight", _wrap_ESetIterator_get_weight}, 
    {"get_description", _wrap_ESetIterator_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_ESetIterator_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_ESetIterator_bases[] = {0};
static char *swig_Xapian_ESetIterator_base_names[] = {0};
static swig_class _wrap_class_Xapian_ESetIterator = { "ESetIterator", &SWIGTYPE_p_Xapian__ESetIterator,_wrap_new_ESetIterator, swig_delete_ESetIterator, swig_Xapian_ESetIterator_methods, swig_Xapian_ESetIterator_attributes, swig_Xapian_ESetIterator_bases,swig_Xapian_ESetIterator_base_names, &swig_module };
SWIGINTERN int
_wrap_new_RSet__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = 0 ;
  Xapian::RSet *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_RSet other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_RSet" "', argument " "1"" of type '" "Xapian::RSet const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RSet" "', argument " "1"" of type '" "Xapian::RSet const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet((Xapian::RSet const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__RSet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_RSet__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_RSet ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__RSet,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_RSet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_RSet__SWIG_1(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Xapian__RSet, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_RSet__SWIG_0(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_RSet'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_RSet(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_RSet self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RSet" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_size(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::RSet_size self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_size" "', argument " "1"" of type '" "Xapian::RSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::RSet const *)arg1)->size();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::RSet_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_empty" "', argument " "1"" of type '" "Xapian::RSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->empty();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_is_empty(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::RSet_is_empty self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_is_empty" "', argument " "1"" of type '" "Xapian::RSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = (bool)Xapian_RSet_is_empty((Xapian::RSet const *)arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_add_document__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_add_document self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_add_document" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RSet_add_document" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->add_document(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_add_document__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_add_document self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_add_document" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RSet_add_document" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RSet_add_document" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      (arg1)->add_document(*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_add_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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) {
      {
        int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_add_document__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'RSet_add_document'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_remove_document__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_remove_document self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_remove_document" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RSet_remove_document" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->remove_document(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_remove_document__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_remove_document self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_remove_document" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RSet_remove_document" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RSet_remove_document" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      (arg1)->remove_document(*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_remove_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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) {
      {
        int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_remove_document__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'RSet_remove_document'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_contains__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_contains self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_contains" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RSet_contains" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (bool)(arg1)->contains(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_contains__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::RSet_contains self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_contains" "', argument " "1"" of type '" "Xapian::RSet *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RSet_contains" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RSet_contains" "', argument " "2"" of type '" "Xapian::MSetIterator &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = (bool)(arg1)->contains(*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_contains(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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) {
      {
        int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_RSet_contains__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'RSet_contains'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_RSet_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::RSet_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RSet_get_description" "', argument " "1"" of type '" "Xapian::RSet const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::RSet * >(argp1);
  {
    try {
      result = ((Xapian::RSet const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_RSet(void *obj) {
Xapian::RSet *arg1 = (Xapian::RSet *) obj;
delete arg1;
}
static swig_method swig_Xapian_RSet_methods[] = {
    {"size", _wrap_RSet_size}, 
    {"empty", _wrap_RSet_empty}, 
    {"is_empty", _wrap_RSet_is_empty}, 
    {"add_document", _wrap_RSet_add_document}, 
    {"remove_document", _wrap_RSet_remove_document}, 
    {"contains", _wrap_RSet_contains}, 
    {"get_description", _wrap_RSet_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_RSet_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_RSet_bases[] = {0};
static char *swig_Xapian_RSet_base_names[] = {0};
static swig_class _wrap_class_Xapian_RSet = { "RSet", &SWIGTYPE_p_Xapian__RSet,_wrap_new_RSet, swig_delete_RSet, swig_Xapian_RSet_methods, swig_Xapian_RSet_attributes, swig_Xapian_RSet_bases,swig_Xapian_RSet_base_names, &swig_module };
SWIGINTERN int
_wrap_new_Enquire(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Enquire *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_Enquire databases ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Enquire" "', argument " "1"" of type '" "Xapian::Database const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Enquire" "', argument " "1"" of type '" "Xapian::Database const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Enquire,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_Enquire(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_Enquire self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Enquire" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_query__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_query self query qlen ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_query" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_set_query" "', argument " "2"" of type '" "Xapian::Query const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_set_query" "', argument " "2"" of type '" "Xapian::Query const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_query" "', argument " "3"" of type '" "Xapian::termcount""'");
  } 
  arg3 = static_cast< Xapian::termcount >(val3);
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_query__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_query self query ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_query" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__Query,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_set_query" "', argument " "2"" of type '" "Xapian::Query const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_set_query" "', argument " "2"" of type '" "Xapian::Query const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::Query * >(argp2);
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_query(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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__Query, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Enquire_set_query__SWIG_1(clientData, interp, objc, argv - 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) {
      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_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_query__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_query'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_query(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Enquire_get_query self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_query" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      {
        Xapian::Query const &_result_ref = (arg1)->get_query();
        result = (Xapian::Query *) &_result_ref;
      }
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Query,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_weighting_scheme(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_weighting_scheme self weight ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_weighting_scheme" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__Weight,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_set_weighting_scheme" "', argument " "2"" of type '" "Xapian::Weight const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_set_weighting_scheme" "', argument " "2"" of type '" "Xapian::Weight const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::Weight * >(argp2);
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_collapse_key(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_collapse_key self collapse_key ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_collapse_key" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_collapse_key" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_docid_order(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_docid_order self order ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_docid_order" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_docid_order" "', argument " "2"" of type '" "Xapian::Enquire::docid_order""'");
  } 
  arg2 = static_cast< Xapian::Enquire::docid_order >(val2);
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_forward(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_sort_forward self sort_forward ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_forward" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_forward" "', argument " "2"" of type '" "bool""'");
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      (arg1)->set_sort_forward(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_cutoff__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  Xapian::weight arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_cutoff self percent_cutoff weight_cutoff ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_cutoff" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_cutoff" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_cutoff" "', argument " "3"" of type '" "Xapian::weight""'");
  } 
  arg3 = static_cast< Xapian::weight >(val3);
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_cutoff__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_cutoff self percent_cutoff ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_cutoff" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_cutoff" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      (arg1)->set_cutoff(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_cutoff(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_set_cutoff__SWIG_1(clientData, interp, objc, argv - 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_int SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_cutoff__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_cutoff'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sorting__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Enquire_set_sorting self sort_key sort_bands sort_by_relevance ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sorting" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sorting" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_sorting" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  ecode4 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_set_sorting" "', argument " "4"" of type '" "bool""'");
  } 
  arg4 = static_cast< bool >(val4);
  {
    try {
      (arg1)->set_sorting(arg2,arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sorting__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_sorting self sort_key sort_bands ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sorting" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sorting" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_sorting" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  {
    try {
      (arg1)->set_sorting(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sorting(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_sorting__SWIG_1(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Enquire_set_sorting__SWIG_0(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_sorting'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_relevance(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Enquire_set_sort_by_relevance self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_relevance" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      (arg1)->set_sort_by_relevance();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_sort_by_value self sort_key ascending ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_value" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_sort_by_value" "', argument " "3"" of type '" "bool""'");
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_sort_by_value self sort_key ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_value" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->set_sort_by_value(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_value__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_value__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_sort_by_value'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_sort_by_value_then_relevance self sort_key ascending ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_value_then_relevance" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_value_then_relevance" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_sort_by_value_then_relevance" "', argument " "3"" of type '" "bool""'");
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_sort_by_value_then_relevance self sort_key ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_value_then_relevance" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_value_then_relevance" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_value_then_relevance(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_sort_by_value_then_relevance'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_sort_by_relevance_then_value self sort_key ascending ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_relevance_then_value" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_relevance_then_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  ecode3 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_set_sort_by_relevance_then_value" "', argument " "3"" of type '" "bool""'");
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_set_sort_by_relevance_then_value self sort_key ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_sort_by_relevance_then_value" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_sort_by_relevance_then_value" "', argument " "2"" of type '" "Xapian::valueno""'");
  } 
  arg2 = static_cast< Xapian::valueno >(val2);
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_sort_by_relevance_then_value(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_set_sort_by_relevance_then_value'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_set_bias(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::weight arg2 ;
  time_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_set_bias self bias_weight bias_halflife ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_set_bias" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_set_bias" "', argument " "2"" of type '" "Xapian::weight""'");
  } 
  arg2 = static_cast< Xapian::weight >(val2);
  {
    res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_time_t,  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_set_bias" "', argument " "3"" of type '" "time_t""'"); 
    }  
    if (!argp3) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_set_bias" "', argument " "3"" of type '" "time_t""'");
    } else {
      arg3 = *(reinterpret_cast< time_t * >(argp3));
    }
  }
  {
    try {
      (arg1)->set_bias(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooooo:xapian::Enquire_get_mset self first maxitems checkatleast omrset mdecider ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_mset" "', argument " "4"" of type '" "Xapian::doccount""'");
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  res5 = SWIG_ConvertPtr(objv[5], &argp5,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Enquire_get_mset" "', argument " "5"" of type '" "Xapian::RSet const *""'"); 
  }
  arg5 = reinterpret_cast< Xapian::RSet * >(argp5);
  res6 = SWIG_ConvertPtr(objv[6], &argp6,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Enquire_get_mset" "', argument " "6"" of type '" "Xapian::MatchDecider const *""'"); 
  }
  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 (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooooo:xapian::Enquire_get_mset self first maxitems checkatleast omrset ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_mset" "', argument " "4"" of type '" "Xapian::doccount""'");
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  res5 = SWIG_ConvertPtr(objv[5], &argp5,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Enquire_get_mset" "', argument " "5"" of type '" "Xapian::RSet const *""'"); 
  }
  arg5 = reinterpret_cast< Xapian::RSet * >(argp5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::MSet result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Enquire_get_mset self first maxitems checkatleast ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_mset" "', argument " "4"" of type '" "Xapian::doccount""'");
  } 
  arg4 = static_cast< Xapian::doccount >(val4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_3(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::MSet result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_get_mset self first maxitems ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_4(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg5 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooooo:xapian::Enquire_get_mset self first maxitems omrset mdecider ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  res4 = SWIG_ConvertPtr(objv[4], &argp4,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Enquire_get_mset" "', argument " "4"" of type '" "Xapian::RSet const *""'"); 
  }
  arg4 = reinterpret_cast< Xapian::RSet * >(argp4);
  res5 = SWIG_ConvertPtr(objv[5], &argp5,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Enquire_get_mset" "', argument " "5"" of type '" "Xapian::MatchDecider const *""'"); 
  }
  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 (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset__SWIG_5(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Enquire_get_mset self first maxitems omrset ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_mset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_mset" "', argument " "2"" of type '" "Xapian::doccount""'");
  } 
  arg2 = static_cast< Xapian::doccount >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Enquire_get_mset" "', argument " "3"" of type '" "Xapian::doccount""'");
  } 
  arg3 = static_cast< Xapian::doccount >(val3);
  res4 = SWIG_ConvertPtr(objv[4], &argp4,SWIGTYPE_p_Xapian__RSet, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Enquire_get_mset" "', argument " "4"" of type '" "Xapian::RSet const *""'"); 
  }
  arg4 = reinterpret_cast< Xapian::RSet * >(argp4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::MSet(static_cast< const Xapian::MSet& >(result))), SWIGTYPE_p_Xapian__MSet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_mset(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Enquire_get_mset__SWIG_3(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(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_get_mset__SWIG_5(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Enquire_get_mset__SWIG_2(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(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_get_mset__SWIG_4(clientData, interp, objc, argv - 1);
            }
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(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_get_mset__SWIG_1(clientData, interp, objc, argv - 1);
            }
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(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_get_mset__SWIG_0(clientData, interp, objc, argv - 1);
              }
            }
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_get_mset'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_eset__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  Xapian::ESet result;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooooo:xapian::Enquire_get_eset self maxitems omrset flags k edecider ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_eset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_eset" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_eset" "', argument " "4"" of type '" "int""'");
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[5], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Enquire_get_eset" "', argument " "5"" of type '" "double""'");
  } 
  arg5 = static_cast< double >(val5);
  res6 = SWIG_ConvertPtr(objv[6], &argp6,SWIGTYPE_p_Xapian__ExpandDecider, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Enquire_get_eset" "', argument " "6"" of type '" "Xapian::ExpandDecider const *""'"); 
  }
  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 (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_eset__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ESet result;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooooo:xapian::Enquire_get_eset self maxitems omrset flags k ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_eset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_eset" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_eset" "', argument " "4"" of type '" "int""'");
  } 
  arg4 = static_cast< int >(val4);
  ecode5 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[5], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Enquire_get_eset" "', argument " "5"" of type '" "double""'");
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_eset__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ESet result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::Enquire_get_eset self maxitems omrset flags ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_eset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_eset" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  ecode4 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Enquire_get_eset" "', argument " "4"" of type '" "int""'");
  } 
  arg4 = static_cast< int >(val4);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_eset__SWIG_3(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ESet result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_get_eset self maxitems omrset ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_eset" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_eset" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__RSet,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_eset" "', argument " "3"" of type '" "Xapian::RSet const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::RSet * >(argp3);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::ESet(static_cast< const Xapian::ESet& >(result))), SWIGTYPE_p_Xapian__ESet, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_eset(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(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_get_eset__SWIG_3(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(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 SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Enquire_get_eset__SWIG_2(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(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 SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_Enquire_get_eset__SWIG_1(clientData, interp, objc, argv - 1);
            }
          }
        }
      }
    }
  }
  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 SWIG_TCL_CALL_ARGS_2(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 SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(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_get_eset__SWIG_0(clientData, interp, objc, argv - 1);
              }
            }
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_get_eset'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_begin__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_get_matching_terms_begin self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_matching_terms_begin" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_matching_terms_begin" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_end__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_get_matching_terms_end self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_matching_terms_end" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Enquire_get_matching_terms_end" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_begin__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_get_matching_terms_begin self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_matching_terms_begin" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_get_matching_terms_begin" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_matching_terms_begin" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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_get_matching_terms_begin__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_begin__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_get_matching_terms_begin'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_end__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_get_matching_terms_end self i ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_matching_terms_end" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_get_matching_terms_end" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_matching_terms_end" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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_get_matching_terms_end__SWIG_1(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_Enquire_get_matching_terms_end__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_get_matching_terms_end'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_register_match_decider__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::MatchDecider *arg3 = (Xapian::MatchDecider *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Enquire_register_match_decider self name mdecider ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_register_match_decider" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_register_match_decider" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_register_match_decider" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(objv[3], &argp3,SWIGTYPE_p_Xapian__MatchDecider, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Enquire_register_match_decider" "', argument " "3"" of type '" "Xapian::MatchDecider const *""'"); 
  }
  arg3 = reinterpret_cast< Xapian::MatchDecider * >(argp3);
  {
    try {
      (arg1)->register_match_decider((std::string const &)*arg2,(Xapian::MatchDecider const *)arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_register_match_decider__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_register_match_decider self name ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_register_match_decider" "', argument " "1"" of type '" "Xapian::Enquire *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_register_match_decider" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_register_match_decider" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->register_match_decider((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_register_match_decider(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Enquire_register_match_decider__SWIG_1(clientData, interp, objc, argv - 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_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Xapian__MatchDecider, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Enquire_register_match_decider__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'Enquire_register_match_decider'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_matching_terms(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  std::pair<Xapian::TermIterator,Xapian::TermIterator > result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Enquire_get_matching_terms self hit ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_matching_terms" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__MSetIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Enquire_get_matching_terms" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Enquire_get_matching_terms" "', argument " "2"" of type '" "Xapian::MSetIterator const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::MSetIterator * >(argp2);
  {
    try {
      result = Xapian_Enquire_get_matching_terms((Xapian::Enquire const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  {
    Tcl_Obj * list = Tcl_NewListObj(0, NULL);
    
    for (Xapian::TermIterator i = (&result)->first; i != (&result)->second; ++i) {
      Tcl_Obj * str = Tcl_NewStringObj((*i).data(), (*i).length());
      if (Tcl_ListObjAppendElement(interp, list, str) != TCL_OK)
      return TCL_ERROR;
    }
    
    Tcl_SetObjResult(interp, list);
  }
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Enquire_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Enquire_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Enquire, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Enquire_get_description" "', argument " "1"" of type '" "Xapian::Enquire const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Enquire * >(argp1);
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_Enquire(void *obj) {
Xapian::Enquire *arg1 = (Xapian::Enquire *) obj;
delete arg1;
}
static swig_method swig_Xapian_Enquire_methods[] = {
    {"set_query", _wrap_Enquire_set_query}, 
    {"get_query", _wrap_Enquire_get_query}, 
    {"set_weighting_scheme", _wrap_Enquire_set_weighting_scheme}, 
    {"set_collapse_key", _wrap_Enquire_set_collapse_key}, 
    {"set_docid_order", _wrap_Enquire_set_docid_order}, 
    {"set_sort_forward", _wrap_Enquire_set_sort_forward}, 
    {"set_cutoff", _wrap_Enquire_set_cutoff}, 
    {"set_sorting", _wrap_Enquire_set_sorting}, 
    {"set_sort_by_relevance", _wrap_Enquire_set_sort_by_relevance}, 
    {"set_sort_by_value", _wrap_Enquire_set_sort_by_value}, 
    {"set_sort_by_value_then_relevance", _wrap_Enquire_set_sort_by_value_then_relevance}, 
    {"set_sort_by_relevance_then_value", _wrap_Enquire_set_sort_by_relevance_then_value}, 
    {"set_bias", _wrap_Enquire_set_bias}, 
    {"get_mset", _wrap_Enquire_get_mset}, 
    {"get_eset", _wrap_Enquire_get_eset}, 
    {"get_matching_terms_begin", _wrap_Enquire_get_matching_terms_begin}, 
    {"get_matching_terms_end", _wrap_Enquire_get_matching_terms_end}, 
    {"register_match_decider", _wrap_Enquire_register_match_decider}, 
    {"get_matching_terms", _wrap_Enquire_get_matching_terms}, 
    {"get_description", _wrap_Enquire_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_Enquire_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_Enquire_bases[] = {0};
static char *swig_Xapian_Enquire_base_names[] = {0};
static swig_class _wrap_class_Xapian_Enquire = { "Enquire", &SWIGTYPE_p_Xapian__Enquire,_wrap_new_Enquire, swig_delete_Enquire, swig_Xapian_Enquire_methods, swig_Xapian_Enquire_attributes, swig_Xapian_Enquire_bases,swig_Xapian_Enquire_base_names, &swig_module };
SWIGINTERN int
_wrap_delete_Weight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_Weight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Weight" "', argument " "1"" of type '" "Xapian::Weight *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Weight_name self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_name" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = ((Xapian::Weight const *)arg1)->name();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_serialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Weight_serialise self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_serialise" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = ((Xapian::Weight const *)arg1)->serialise();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_unserialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Weight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Weight_unserialise self s ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_unserialise" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Weight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Weight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::Weight *)((Xapian::Weight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Weight,0));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_get_sumpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Weight_get_sumpart self wdf len ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_get_sumpart" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Weight_get_sumpart" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Weight_get_sumpart" "', argument " "3"" of type '" "Xapian::doclength""'");
  } 
  arg3 = static_cast< Xapian::doclength >(val3);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_get_maxpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Weight_get_maxpart self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_get_maxpart" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxpart();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_get_sumextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Weight_get_sumextra self len ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_get_sumextra" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Weight_get_sumextra" "', argument " "2"" of type '" "Xapian::doclength""'");
  } 
  arg2 = static_cast< Xapian::doclength >(val2);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumextra(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_get_maxextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Weight_get_maxextra self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_get_maxextra" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxextra();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Weight_get_sumpart_needs_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Weight_get_sumpart_needs_doclength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Weight_get_sumpart_needs_doclength" "', argument " "1"" of type '" "Xapian::Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Weight * >(argp1);
  {
    try {
      result = (bool)((Xapian::Weight const *)arg1)->get_sumpart_needs_doclength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_Weight(void *obj) {
Xapian::Weight *arg1 = (Xapian::Weight *) obj;
delete arg1;
}
static swig_method swig_Xapian_Weight_methods[] = {
    {"name", _wrap_Weight_name}, 
    {"serialise", _wrap_Weight_serialise}, 
    {"unserialise", _wrap_Weight_unserialise}, 
    {"get_sumpart", _wrap_Weight_get_sumpart}, 
    {"get_maxpart", _wrap_Weight_get_maxpart}, 
    {"get_sumextra", _wrap_Weight_get_sumextra}, 
    {"get_maxextra", _wrap_Weight_get_maxextra}, 
    {"get_sumpart_needs_doclength", _wrap_Weight_get_sumpart_needs_doclength}, 
    {0,0}
};
static swig_attribute swig_Xapian_Weight_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_Weight_bases[] = {0};
static char *swig_Xapian_Weight_base_names[] = {0};
static swig_class _wrap_class_Xapian_Weight = { "Weight", &SWIGTYPE_p_Xapian__Weight,0, swig_delete_Weight, swig_Xapian_Weight_methods, swig_Xapian_Weight_attributes, swig_Xapian_Weight_bases,swig_Xapian_Weight_base_names, &swig_module };
SWIGINTERN int
_wrap_BoolWeight_clone(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::BoolWeight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_clone self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_clone" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->clone();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BoolWeight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_BoolWeight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_BoolWeight ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BoolWeight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_BoolWeight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_BoolWeight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BoolWeight" "', argument " "1"" of type '" "Xapian::BoolWeight *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_name self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_name" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->name();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_serialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_serialise self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_serialise" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->serialise();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_unserialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BoolWeight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::BoolWeight_unserialise self s ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_unserialise" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BoolWeight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "BoolWeight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BoolWeight,0));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_get_sumpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::BoolWeight_get_sumpart self wdf len ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_get_sumpart" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BoolWeight_get_sumpart" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BoolWeight_get_sumpart" "', argument " "3"" of type '" "Xapian::doclength""'");
  } 
  arg3 = static_cast< Xapian::doclength >(val3);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_get_maxpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_get_maxpart self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_get_maxpart" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxpart();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_get_sumextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::BoolWeight_get_sumextra self len ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_get_sumextra" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BoolWeight_get_sumextra" "', argument " "2"" of type '" "Xapian::doclength""'");
  } 
  arg2 = static_cast< Xapian::doclength >(val2);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumextra(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_get_maxextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_get_maxextra self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_get_maxextra" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxextra();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BoolWeight_get_sumpart_needs_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BoolWeight_get_sumpart_needs_doclength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BoolWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BoolWeight_get_sumpart_needs_doclength" "', argument " "1"" of type '" "Xapian::BoolWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BoolWeight * >(argp1);
  {
    try {
      result = (bool)((Xapian::BoolWeight const *)arg1)->get_sumpart_needs_doclength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_BoolWeight(void *obj) {
Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) obj;
delete arg1;
}
static swig_method swig_Xapian_BoolWeight_methods[] = {
    {"clone", _wrap_BoolWeight_clone}, 
    {"name", _wrap_BoolWeight_name}, 
    {"serialise", _wrap_BoolWeight_serialise}, 
    {"unserialise", _wrap_BoolWeight_unserialise}, 
    {"get_sumpart", _wrap_BoolWeight_get_sumpart}, 
    {"get_maxpart", _wrap_BoolWeight_get_maxpart}, 
    {"get_sumextra", _wrap_BoolWeight_get_sumextra}, 
    {"get_maxextra", _wrap_BoolWeight_get_maxextra}, 
    {"get_sumpart_needs_doclength", _wrap_BoolWeight_get_sumpart_needs_doclength}, 
    {0,0}
};
static swig_attribute swig_Xapian_BoolWeight_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_BoolWeight_bases[] = {0,0};
static char *swig_Xapian_BoolWeight_base_names[] = {"Xapian::Weight *",0};
static swig_class _wrap_class_Xapian_BoolWeight = { "BoolWeight", &SWIGTYPE_p_Xapian__BoolWeight,_wrap_new_BoolWeight, swig_delete_BoolWeight, swig_Xapian_BoolWeight_methods, swig_Xapian_BoolWeight_attributes, swig_Xapian_BoolWeight_bases,swig_Xapian_BoolWeight_base_names, &swig_module };
SWIGINTERN int
_wrap_new_BM25Weight__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  Xapian::BM25Weight *result = 0 ;
  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 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooooo:xapian::new_BM25Weight k1_ k2_ k3_ b_ min_normlen_ ",(void *)0,(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  ecode1 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[1], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_BM25Weight" "', argument " "1"" of type '" "double""'");
  } 
  arg1 = static_cast< double >(val1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_BM25Weight" "', argument " "2"" of type '" "double""'");
  } 
  arg2 = static_cast< double >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_BM25Weight" "', argument " "3"" of type '" "double""'");
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_BM25Weight" "', argument " "4"" of type '" "double""'");
  } 
  arg4 = static_cast< double >(val4);
  ecode5 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[5], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_BM25Weight" "', argument " "5"" of type '" "double""'");
  } 
  arg5 = static_cast< double >(val5);
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight(arg1,arg2,arg3,arg4,arg5);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BM25Weight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_BM25Weight__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_BM25Weight ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BM25Weight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_BM25Weight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_BM25Weight__SWIG_1(clientData, interp, objc, argv - 1);
  }
  if (argc == 5) {
    int _v;
    {
      int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              return _wrap_new_BM25Weight__SWIG_0(clientData, interp, objc, argv - 1);
            }
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_BM25Weight'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_clone(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::BM25Weight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_clone self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_clone" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (Xapian::BM25Weight *)((Xapian::BM25Weight const *)arg1)->clone();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BM25Weight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_BM25Weight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_BM25Weight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BM25Weight" "', argument " "1"" of type '" "Xapian::BM25Weight *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_name self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_name" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->name();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_serialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_serialise self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_serialise" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->serialise();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_unserialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BM25Weight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::BM25Weight_unserialise self s ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_unserialise" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BM25Weight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "BM25Weight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::BM25Weight *)((Xapian::BM25Weight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__BM25Weight,0));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_get_sumpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::BM25Weight_get_sumpart self wdf len ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_get_sumpart" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BM25Weight_get_sumpart" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BM25Weight_get_sumpart" "', argument " "3"" of type '" "Xapian::doclength""'");
  } 
  arg3 = static_cast< Xapian::doclength >(val3);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_get_maxpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_get_maxpart self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_get_maxpart" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxpart();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_get_sumextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::BM25Weight_get_sumextra self len ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_get_sumextra" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BM25Weight_get_sumextra" "', argument " "2"" of type '" "Xapian::doclength""'");
  } 
  arg2 = static_cast< Xapian::doclength >(val2);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumextra(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_get_maxextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_get_maxextra self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_get_maxextra" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxextra();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_BM25Weight_get_sumpart_needs_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::BM25Weight_get_sumpart_needs_doclength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__BM25Weight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BM25Weight_get_sumpart_needs_doclength" "', argument " "1"" of type '" "Xapian::BM25Weight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::BM25Weight * >(argp1);
  {
    try {
      result = (bool)((Xapian::BM25Weight const *)arg1)->get_sumpart_needs_doclength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_BM25Weight(void *obj) {
Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) obj;
delete arg1;
}
static swig_method swig_Xapian_BM25Weight_methods[] = {
    {"clone", _wrap_BM25Weight_clone}, 
    {"name", _wrap_BM25Weight_name}, 
    {"serialise", _wrap_BM25Weight_serialise}, 
    {"unserialise", _wrap_BM25Weight_unserialise}, 
    {"get_sumpart", _wrap_BM25Weight_get_sumpart}, 
    {"get_maxpart", _wrap_BM25Weight_get_maxpart}, 
    {"get_sumextra", _wrap_BM25Weight_get_sumextra}, 
    {"get_maxextra", _wrap_BM25Weight_get_maxextra}, 
    {"get_sumpart_needs_doclength", _wrap_BM25Weight_get_sumpart_needs_doclength}, 
    {0,0}
};
static swig_attribute swig_Xapian_BM25Weight_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_BM25Weight_bases[] = {0,0};
static char *swig_Xapian_BM25Weight_base_names[] = {"Xapian::Weight *",0};
static swig_class _wrap_class_Xapian_BM25Weight = { "BM25Weight", &SWIGTYPE_p_Xapian__BM25Weight,_wrap_new_BM25Weight, swig_delete_BM25Weight, swig_Xapian_BM25Weight_methods, swig_Xapian_BM25Weight_attributes, swig_Xapian_BM25Weight_bases,swig_Xapian_BM25Weight_base_names, &swig_module };
SWIGINTERN int
_wrap_new_TradWeight__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  double arg1 ;
  Xapian::TradWeight *result = 0 ;
  double val1 ;
  int ecode1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_TradWeight k ",(void *)0) == TCL_ERROR) SWIG_fail;
  ecode1 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[1], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_TradWeight" "', argument " "1"" of type '" "double""'");
  } 
  arg1 = static_cast< double >(val1);
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight(arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TradWeight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_TradWeight__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_TradWeight ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TradWeight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_TradWeight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_TradWeight__SWIG_1(clientData, interp, objc, argv - 1);
  }
  if (argc == 1) {
    int _v;
    {
      int res = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_TradWeight__SWIG_0(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_TradWeight'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_clone(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::TradWeight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_clone self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_clone" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (Xapian::TradWeight *)((Xapian::TradWeight const *)arg1)->clone();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TradWeight,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_TradWeight(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_TradWeight self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_TradWeight" "', argument " "1"" of type '" "Xapian::TradWeight *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_name self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_name" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->name();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_serialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_serialise self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_serialise" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->serialise();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_unserialise(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TradWeight *result = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::TradWeight_unserialise self s ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_unserialise" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TradWeight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TradWeight_unserialise" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::TradWeight *)((Xapian::TradWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__TradWeight,0));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_get_sumpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::TradWeight_get_sumpart self wdf len ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_get_sumpart" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TradWeight_get_sumpart" "', argument " "2"" of type '" "Xapian::termcount""'");
  } 
  arg2 = static_cast< Xapian::termcount >(val2);
  ecode3 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TradWeight_get_sumpart" "', argument " "3"" of type '" "Xapian::doclength""'");
  } 
  arg3 = static_cast< Xapian::doclength >(val3);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_get_maxpart(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_get_maxpart self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_get_maxpart" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxpart();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_get_sumextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::TradWeight_get_sumextra self len ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_get_sumextra" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  ecode2 = SWIG_AsVal_double SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TradWeight_get_sumextra" "', argument " "2"" of type '" "Xapian::doclength""'");
  } 
  arg2 = static_cast< Xapian::doclength >(val2);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumextra(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_get_maxextra(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_get_maxextra self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_get_maxextra" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxextra();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_TradWeight_get_sumpart_needs_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::TradWeight_get_sumpart_needs_doclength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__TradWeight, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TradWeight_get_sumpart_needs_doclength" "', argument " "1"" of type '" "Xapian::TradWeight const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::TradWeight * >(argp1);
  {
    try {
      result = (bool)((Xapian::TradWeight const *)arg1)->get_sumpart_needs_doclength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_TradWeight(void *obj) {
Xapian::TradWeight *arg1 = (Xapian::TradWeight *) obj;
delete arg1;
}
static swig_method swig_Xapian_TradWeight_methods[] = {
    {"clone", _wrap_TradWeight_clone}, 
    {"name", _wrap_TradWeight_name}, 
    {"serialise", _wrap_TradWeight_serialise}, 
    {"unserialise", _wrap_TradWeight_unserialise}, 
    {"get_sumpart", _wrap_TradWeight_get_sumpart}, 
    {"get_maxpart", _wrap_TradWeight_get_maxpart}, 
    {"get_sumextra", _wrap_TradWeight_get_sumextra}, 
    {"get_maxextra", _wrap_TradWeight_get_maxextra}, 
    {"get_sumpart_needs_doclength", _wrap_TradWeight_get_sumpart_needs_doclength}, 
    {0,0}
};
static swig_attribute swig_Xapian_TradWeight_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_TradWeight_bases[] = {0,0};
static char *swig_Xapian_TradWeight_base_names[] = {"Xapian::Weight *",0};
static swig_class _wrap_class_Xapian_TradWeight = { "TradWeight", &SWIGTYPE_p_Xapian__TradWeight,_wrap_new_TradWeight, swig_delete_TradWeight, swig_Xapian_TradWeight_methods, swig_Xapian_TradWeight_attributes, swig_Xapian_TradWeight_bases,swig_Xapian_TradWeight_base_names, &swig_module };
SWIGINTERN int
_wrap_Database_add_database(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_add_database self database ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_add_database" "', argument " "1"" of type '" "Xapian::Database *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_add_database" "', argument " "2"" of type '" "Xapian::Database const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_add_database" "', argument " "2"" of type '" "Xapian::Database const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::Database * >(argp2);
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Database__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_Database ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Database,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Database__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_Database path ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Database" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Database" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Database,0));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_delete_Database(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_Database self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Database" "', argument " "1"" of type '" "Xapian::Database *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Database__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_Database other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__Database,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Database" "', argument " "1"" of type '" "Xapian::Database const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Database" "', argument " "1"" of type '" "Xapian::Database const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((Xapian::Database const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__Database,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_Database(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_Database__SWIG_0(clientData, interp, objc, argv - 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_new_Database__SWIG_2(clientData, interp, objc, argv - 1);
    }
  }
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Database__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_Database'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_reopen(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_reopen self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_reopen" "', argument " "1"" of type '" "Xapian::Database *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      (arg1)->reopen();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_description" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_postlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_postlist_begin self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_postlist_begin" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_postlist_begin" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_postlist_begin" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PostingIterator(static_cast< const Xapian::PostingIterator& >(result))), SWIGTYPE_p_Xapian__PostingIterator, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_postlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_postlist_end self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_postlist_end" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_postlist_end" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_postlist_end" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PostingIterator(static_cast< const Xapian::PostingIterator& >(result))), SWIGTYPE_p_Xapian__PostingIterator, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_termlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_termlist_begin self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_termlist_begin" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_termlist_begin" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_begin(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_termlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_termlist_end self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_termlist_end" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_termlist_end" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_positionlist_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Database_positionlist_begin self did tname ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_positionlist_begin" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_positionlist_begin" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[3], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Database_positionlist_begin" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_positionlist_begin" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_positionlist_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  int res3 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::Database_positionlist_end self did tname ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_positionlist_end" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_positionlist_end" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[3], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Database_positionlist_end" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_positionlist_end" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::PositionIterator(static_cast< const Xapian::PositionIterator& >(result))), SWIGTYPE_p_Xapian__PositionIterator, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_allterms_begin(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_allterms_begin self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_allterms_begin" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_allterms_end(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_allterms_end self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_allterms_end" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_end();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::TermIterator(static_cast< const Xapian::TermIterator& >(result))), SWIGTYPE_p_Xapian__TermIterator, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_doccount(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_get_doccount self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_doccount" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_doccount();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_lastdocid(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_get_lastdocid self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_lastdocid" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::docid)((Xapian::Database const *)arg1)->get_lastdocid();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_avlength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doclength result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_get_avlength self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_avlength" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_avlength();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_termfreq(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::doccount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_get_termfreq self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_termfreq" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_get_termfreq" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_get_termfreq" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_term_exists(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_term_exists self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_term_exists" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_term_exists" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_term_exists" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_bool(static_cast< bool >(result)));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_collection_freq(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_get_collection_freq self tname ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_collection_freq" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Database_get_collection_freq" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Database_get_collection_freq" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_doclength(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::doclength result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_get_doclength self docid ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_doclength" "', argument " "1"" of type '" "Xapian::Database const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_get_doclength" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_doclength(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_double(static_cast< double >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_keep_alive(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::Database_keep_alive self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_keep_alive" "', argument " "1"" of type '" "Xapian::Database *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  {
    try {
      (arg1)->keep_alive();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_Database_get_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::Database_get_document self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__Database, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Database_get_document" "', argument " "1"" of type '" "Xapian::Database *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::Database * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Database_get_document" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      result = (arg1)->get_document(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Document(static_cast< const Xapian::Document& >(result))), SWIGTYPE_p_Xapian__Document, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_Database(void *obj) {
Xapian::Database *arg1 = (Xapian::Database *) obj;
delete arg1;
}
static swig_method swig_Xapian_Database_methods[] = {
    {"add_database", _wrap_Database_add_database}, 
    {"reopen", _wrap_Database_reopen}, 
    {"get_description", _wrap_Database_get_description}, 
    {"postlist_begin", _wrap_Database_postlist_begin}, 
    {"postlist_end", _wrap_Database_postlist_end}, 
    {"termlist_begin", _wrap_Database_termlist_begin}, 
    {"termlist_end", _wrap_Database_termlist_end}, 
    {"positionlist_begin", _wrap_Database_positionlist_begin}, 
    {"positionlist_end", _wrap_Database_positionlist_end}, 
    {"allterms_begin", _wrap_Database_allterms_begin}, 
    {"allterms_end", _wrap_Database_allterms_end}, 
    {"get_doccount", _wrap_Database_get_doccount}, 
    {"get_lastdocid", _wrap_Database_get_lastdocid}, 
    {"get_avlength", _wrap_Database_get_avlength}, 
    {"get_termfreq", _wrap_Database_get_termfreq}, 
    {"term_exists", _wrap_Database_term_exists}, 
    {"get_collection_freq", _wrap_Database_get_collection_freq}, 
    {"get_doclength", _wrap_Database_get_doclength}, 
    {"keep_alive", _wrap_Database_keep_alive}, 
    {"get_document", _wrap_Database_get_document}, 
    {0,0}
};
static swig_attribute swig_Xapian_Database_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_Database_bases[] = {0};
static char *swig_Xapian_Database_base_names[] = {0};
static swig_class _wrap_class_Xapian_Database = { "Database", &SWIGTYPE_p_Xapian__Database,_wrap_new_Database, swig_delete_Database, swig_Xapian_Database_methods, swig_Xapian_Database_attributes, swig_Xapian_Database_bases,swig_Xapian_Database_base_names, &swig_module };
SWIGINTERN int
_wrap_delete_WritableDatabase(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::delete_WritableDatabase self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WritableDatabase" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      delete arg1;
      
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_WritableDatabase__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *result = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::new_WritableDatabase ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__WritableDatabase,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_WritableDatabase__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase *result = 0 ;
  int res1 = SWIG_OLDOBJ ;
  int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::new_WritableDatabase path action ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_WritableDatabase" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_WritableDatabase" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_WritableDatabase" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__WritableDatabase,0));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_WritableDatabase__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = 0 ;
  Xapian::WritableDatabase *result = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::new_WritableDatabase other ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1, SWIGTYPE_p_Xapian__WritableDatabase,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_WritableDatabase" "', argument " "1"" of type '" "Xapian::WritableDatabase const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_WritableDatabase" "', argument " "1"" of type '" "Xapian::WritableDatabase const &""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((Xapian::WritableDatabase const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_Xapian__WritableDatabase,0));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_new_WritableDatabase(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 0) {
    return _wrap_new_WritableDatabase__SWIG_0(clientData, interp, objc, argv - 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_new_WritableDatabase__SWIG_2(clientData, interp, objc, argv - 1);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_new_WritableDatabase__SWIG_1(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'new_WritableDatabase'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_flush(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::WritableDatabase_flush self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_flush" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->flush();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_begin_transaction__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::WritableDatabase_begin_transaction self flushed ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_begin_transaction" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WritableDatabase_begin_transaction" "', argument " "2"" of type '" "bool""'");
  } 
  arg2 = static_cast< bool >(val2);
  {
    try {
      (arg1)->begin_transaction(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_begin_transaction__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::WritableDatabase_begin_transaction self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_begin_transaction" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->begin_transaction();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_begin_transaction(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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(clientData, interp, objc, argv - 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_bool SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_WritableDatabase_begin_transaction__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'WritableDatabase_begin_transaction'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_commit_transaction(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::WritableDatabase_commit_transaction self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_commit_transaction" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->commit_transaction();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_cancel_transaction(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::WritableDatabase_cancel_transaction self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_cancel_transaction" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      (arg1)->cancel_transaction();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_add_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::WritableDatabase_add_document self document ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_add_document" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  res2 = SWIG_ConvertPtr(objv[2], &argp2, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WritableDatabase_add_document" "', argument " "2"" of type '" "Xapian::Document const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WritableDatabase_add_document" "', argument " "2"" of type '" "Xapian::Document const &""'"); 
  }
  arg2 = reinterpret_cast< Xapian::Document * >(argp2);
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_delete_document__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::WritableDatabase_delete_document self did ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_delete_document" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WritableDatabase_delete_document" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  {
    try {
      (arg1)->delete_document(arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_replace_document__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  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 (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::WritableDatabase_replace_document self did document ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_replace_document" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WritableDatabase_replace_document" "', argument " "2"" of type '" "Xapian::docid""'");
  } 
  arg2 = static_cast< Xapian::docid >(val2);
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WritableDatabase_replace_document" "', argument " "3"" of type '" "Xapian::Document const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WritableDatabase_replace_document" "', argument " "3"" of type '" "Xapian::Document const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::Document * >(argp3);
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_delete_document__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::WritableDatabase_delete_document self unique_term ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_delete_document" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WritableDatabase_delete_document" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WritableDatabase_delete_document" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_delete_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_0(clientData, interp, objc, argv - 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 SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_WritableDatabase_delete_document__SWIG_1(clientData, interp, objc, argv - 1);
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'WritableDatabase_delete_document'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_replace_document__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  Xapian::docid result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  void *argp3 ;
  int res3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::WritableDatabase_replace_document self unique_term document ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_replace_document" "', argument " "1"" of type '" "Xapian::WritableDatabase *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WritableDatabase_replace_document" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WritableDatabase_replace_document" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  res3 = SWIG_ConvertPtr(objv[3], &argp3, SWIGTYPE_p_Xapian__Document,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WritableDatabase_replace_document" "', argument " "3"" of type '" "Xapian::Document const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WritableDatabase_replace_document" "', argument " "3"" of type '" "Xapian::Document const &""'"); 
  }
  arg3 = reinterpret_cast< Xapian::Document * >(argp3);
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)));
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_replace_document(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-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 SWIG_TCL_CALL_ARGS_2(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(clientData, interp, objc, argv - 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_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(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(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'WritableDatabase_replace_document'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_WritableDatabase_get_description(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string result;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::WritableDatabase_get_description self ",(void *)0) == TCL_ERROR) SWIG_fail;
  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_Xapian__WritableDatabase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WritableDatabase_get_description" "', argument " "1"" of type '" "Xapian::WritableDatabase const *""'"); 
  }
  arg1 = reinterpret_cast< Xapian::WritableDatabase * >(argp1);
  {
    try {
      result = ((Xapian::WritableDatabase const *)arg1)->get_description();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_From_std_string(static_cast< std::string >(result)));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN void swig_delete_WritableDatabase(void *obj) {
Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) obj;
delete arg1;
}
static swig_method swig_Xapian_WritableDatabase_methods[] = {
    {"flush", _wrap_WritableDatabase_flush}, 
    {"begin_transaction", _wrap_WritableDatabase_begin_transaction}, 
    {"commit_transaction", _wrap_WritableDatabase_commit_transaction}, 
    {"cancel_transaction", _wrap_WritableDatabase_cancel_transaction}, 
    {"add_document", _wrap_WritableDatabase_add_document}, 
    {"delete_document", _wrap_WritableDatabase_delete_document}, 
    {"replace_document", _wrap_WritableDatabase_replace_document}, 
    {"get_description", _wrap_WritableDatabase_get_description}, 
    {0,0}
};
static swig_attribute swig_Xapian_WritableDatabase_attributes[] = {
    {0,0,0}
};
static swig_class *swig_Xapian_WritableDatabase_bases[] = {0,0};
static char *swig_Xapian_WritableDatabase_base_names[] = {"Xapian::Database *",0};
static swig_class _wrap_class_Xapian_WritableDatabase = { "WritableDatabase", &SWIGTYPE_p_Xapian__WritableDatabase,_wrap_new_WritableDatabase, swig_delete_WritableDatabase, swig_Xapian_WritableDatabase_methods, swig_Xapian_WritableDatabase_attributes, swig_Xapian_WritableDatabase_bases,swig_Xapian_WritableDatabase_base_names, &swig_module };
SWIGINTERN int
_wrap_open(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::open path ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Auto::open((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_stub(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::open_stub file ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_stub" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_stub" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Auto::open_stub((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_quartz_open(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::quartz_open dir ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "quartz_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "quartz_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Quartz::open((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_flint_open(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::flint_open dir ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "flint_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "flint_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_inmemory_open(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Xapian::WritableDatabase result;
  
  if (SWIG_GetArgs(interp, objc, objv,":xapian::inmemory_open ") == TCL_ERROR) SWIG_fail;
  {
    try {
      result = Xapian::InMemory::open();
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::WritableDatabase(static_cast< const Xapian::WritableDatabase& >(result))), SWIGTYPE_p_Xapian__WritableDatabase, SWIG_POINTER_OWN | 0 ));
  return TCL_OK;
fail:
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_da__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  bool val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::open_da R T heavy_duty ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "open_da" "', argument " "3"" of type '" "bool""'");
  } 
  arg3 = static_cast< bool >(val3);
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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 TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_da__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::open_da R T ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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 TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_da__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  bool val4 ;
  int ecode4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::open_da R T values heavy_duty ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[3], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "open_da" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    arg3 = ptr;
  }
  ecode4 = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "open_da" "', argument " "4"" of type '" "bool""'");
  } 
  arg4 = static_cast< bool >(val4);
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,(std::string const &)*arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_da__SWIG_3(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  int res3 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::open_da R T values ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res3 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[3], &ptr);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "open_da" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_da" "', argument " "3"" of type '" "std::string const &""'"); 
    }
    arg3 = ptr;
  }
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,(std::string const &)*arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  if (SWIG_IsNewObj(res3)) delete arg3;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_da(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_open_da__SWIG_1(clientData, interp, objc, argv - 1);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_open_da__SWIG_0(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_open_da__SWIG_3(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[2], (std::string**)(0));
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_bool SWIG_TCL_CALL_ARGS_2(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_open_da__SWIG_2(clientData, interp, objc, argv - 1);
          }
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'open_da'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_db__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  size_t arg2 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  size_t val2 ;
  int ecode2 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::open_db DB cache_size ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_size_t SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "open_db" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1,arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_db__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"o:xapian::open_db DB ",(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_db__SWIG_2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  size_t val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::open_db DB values cache_size ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_db" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  ecode3 = SWIG_AsVal_size_t SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "open_db" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = static_cast< size_t >(val3);
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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 TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_db__SWIG_3(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  int res2 = SWIG_OLDOBJ ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oo:xapian::open_db DB values ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  {
    std::string *ptr = (std::string *)0;
    res2 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[2], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_db" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "open_db" "', argument " "2"" of type '" "std::string const &""'"); 
    }
    arg2 = ptr;
  }
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((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 TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  if (SWIG_IsNewObj(res2)) delete arg2;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_open_db(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  Tcl_Obj *CONST *argv = objv+1;
  int argc = objc-1;
  if (argc == 1) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_open_db__SWIG_1(clientData, interp, objc, argv - 1);
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_size_t SWIG_TCL_CALL_ARGS_2(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_open_db__SWIG_0(clientData, interp, objc, argv - 1);
      }
    }
  }
  if (argc == 2) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_open_db__SWIG_3(clientData, interp, objc, argv - 1);
      }
    }
  }
  if (argc == 3) {
    int _v;
    int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[0], (std::string**)(0));
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(argv[1], (std::string**)(0));
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_size_t SWIG_TCL_CALL_ARGS_2(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_open_db__SWIG_2(clientData, interp, objc, argv - 1);
        }
      }
    }
  }
  
  Tcl_SetResult(interp,(char *) "No matching function for overloaded 'open_db'", TCL_STATIC);
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_remote_open__SWIG_0(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"oooo:xapian::remote_open host port timeout connect_timeout ",(void *)0,(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "remote_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "remote_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "remote_open" "', argument " "2"" of type '" "unsigned int""'");
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "remote_open" "', argument " "3"" of type '" "Xapian::timeout""'");
  } 
  arg3 = static_cast< Xapian::timeout >(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[4], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "remote_open" "', argument " "4"" of type '" "Xapian::timeout""'");
  } 
  arg4 = static_cast< Xapian::timeout >(val4);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_SetObjResult(interp,SWIG_NewInstanceObj((new Xapian::Database(static_cast< const Xapian::Database& >(result))), SWIGTYPE_p_Xapian__Database, SWIG_POINTER_OWN | 0 ));
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_OK;
fail:
  if (SWIG_IsNewObj(res1)) delete arg1;
  return TCL_ERROR;
}


SWIGINTERN int
_wrap_remote_open__SWIG_1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::Database result;
  int res1 = SWIG_OLDOBJ ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  
  if (SWIG_GetArgs(interp, objc, objv,"ooo:xapian::remote_open host port timeout ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
  {
    std::string *ptr = (std::string *)0;
    res1 = SWIG_AsPtr_std_string SWIG_TCL_CALL_ARGS_2(objv[1], &ptr);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "remote_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "remote_open" "', argument " "1"" of type '" "std::string const &""'"); 
    }
    arg1 = ptr;
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "remote_open" "', argument " "2"" of type '" "unsigned int""'");
  } 
  arg2 = static_cast< unsigned int >(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[3], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "remote_open" "', argument " "3"" of type '" "Xapian::timeout""'");
  } 
  arg3 = static_cast< Xapian::timeout >(val3);
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3);
    } catch (const Xapian::Error &e) {
      return XapianTclHandleError(interp, e);
    } catch (const char * str) {
      return XapianTclHandleError(interp, str);
    } catch (...) {
      return XapianTclHandleError(interp);
    }
  }
  Tcl_Set