/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.4.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


#define SWIG_VERSION 0x040401
#define SWIGLUA
#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
#define SWIG_LUA_MODULE_GLOBAL

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#if defined(__cplusplus) && __cplusplus >=201103L
# define SWIG_NOEXCEPT noexcept
#else
# define SWIG_NOEXCEPT throw()
#endif 

/* -----------------------------------------------------------------------------
 * swigcompat.swg
 *
 * Macros to provide support compatibility with older C and C++ standards.
 *
 * Note that SWIG expects __cplusplus to be defined to the appropriate C++ standard.
 * MSVC users are urged to check and examine the /Zc:__cplusplus compiler option.
 * See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus.
 * ----------------------------------------------------------------------------- */

/* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF
 * if you're missing it.
 */
#if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \
     (defined __cplusplus && __cplusplus >= 201103L) || \
     defined SWIG_HAVE_SNPRINTF) && \
    !defined SWIG_NO_SNPRINTF
# define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A)
# define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B)
#else
/* Fallback versions ignore the buffer size, but most of our uses either have a
 * fixed maximum possible size or dynamically allocate a buffer that's large
 * enough.
 */
# define SWIG_snprintf(O,S,F,A) sprintf(O,F,A)
# define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B)
#endif

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

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

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

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

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

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

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

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2
#define SWIG_POINTER_NO_NULL       0x4
#define SWIG_POINTER_CLEAR         0x8
#define SWIG_POINTER_RELEASE       (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN)

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


/*
   Flags/methods for returning states.

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

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

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

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

   Now you can be more explicit:

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

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

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

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

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

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

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows returning 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)
/* Runtime errors are < 0 */
#define SWIG_ERROR                 (-1)
/* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */
/* Errors in range -100 to -199 are language specific errors defined in *errors.swg */
/* Errors < -200 are generic runtime specific errors */
#define SWIG_ERROR_RELEASE_NOT_OWNED (-200)

#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 temporary 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 object mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

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


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

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

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

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next array of casts | pointer to cast hashed by value */
  unsigned int            value;		/* index of the last valid element in the array | typename hash value */
} swig_cast_info;

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

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

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

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

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}

/*
 * Hash function for type name strings, based on maRushPrime1Hash (http://amsoftware.narod.ru/algo2.html)
 */
SWIGRUNTIME unsigned int SWIG_Hash(const char *str, unsigned int len) {
  const unsigned char *data = (const unsigned char *)str;
  unsigned int hash = len, i = 0, k;
  int rem = (int)len;

  while (rem >= (int)sizeof(unsigned int)) {
    memcpy(&k, data, sizeof(unsigned int));
    k += i++;
    hash ^= k;
    hash *= 171717;
    data += sizeof(unsigned int);
    rem -= sizeof(unsigned int);
  }

  switch (rem) {
    case 3: k = (unsigned int)(data[2]) << 16;
            k |= (unsigned int)(data[1]) << 8;
            k |= (unsigned int)(data[0]);
            k += i++;
            hash ^= k;
            hash *= 171717;
            break;
    case 2: k = (unsigned int)(data[1]) << 8;
            k |= (unsigned int)(data[0]);
            k += i++;
            hash ^= k;
            hash *= 171717;
            break;
    case 1: k = (unsigned int)(data[0]);
            k += i++;
            hash ^= k;
            hash *= 171717;
            break;
  }
  return hash;
}

/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  static const unsigned int scan_threshold = 4;
  if (ty) {
    swig_cast_info *head = ty->cast;
    unsigned int hash_value = 0;
    int hashed = 0;

    while (head) {

      if (strcmp(head->type->name, c) == 0) {
        return head;
      }

      if (head->value) {
        swig_cast_info *iter;
        swig_cast_info *last = head + head->value;
        swig_cast_info *first = head + 1;
        int search = 1;

        if (!hashed) {
          if (head->value < scan_threshold) {
            for (iter = first; iter <= last; iter++) {
              if (strcmp(iter->type->name, c) == 0) {
                return iter;
              }
            }
            search = 0;
          } else {
            hashed = 1;
            hash_value = SWIG_Hash(c, (unsigned int)strlen(c));
          }
        }

        if (search) {
          /* Binary search over sorted <'next'|'value'> pairs */
          do {
            iter = first + ((last - first) >> 1);
            if (iter->value < hash_value) {
              first = iter + 1;
            } else if (iter->value == hash_value) {

              if (strcmp(iter->next->type->name, c) == 0) {
                return iter->next;
              }

              /* Hash collision check */
              for (last = iter + 1; last->next && last->value == hash_value; last++) {
                if (strcmp(last->next->type->name, c) == 0) {
                  return last->next;
                }
              }
              for (first = iter - 1; first != head && first->value == hash_value; first--) {
                if (strcmp(first->next->type->name, c) == 0) {
                  return first->next;
                }
              }
              break;
            } else
              last = iter - 1;
          } while (first <= last);
        }
      }
      head = head->next;
    }
  }
  return 0;
}

/*
  Check the type by type address
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *head = ty->cast;
    while (head) {
      if (head->type == from) {
        return head;
      }

      if (head->value) {
        swig_cast_info *iter;
        swig_cast_info *last = head + head->value;
        swig_cast_info *first = head + 1;

        /* Binary search over sorted array of casts */
        do {
          iter = first + ((last - first) >> 1);
          if (iter->type < from) {
            first = iter + 1;
          } else if (iter->type == from) {
            return iter;
          } else
            last = iter - 1;
        } while (first <= last);
      }
      head = head->next;
    }
  }
  return 0;
}

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

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

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

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  Choose the last
     name. It should be the most specific; a fully resolved name
     but not necessarily with default template parameters expanded. */
  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 *head = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;

  while (head) {
    swig_cast_info *cast;
    for (cast = head; (cast - head) <= head->value; cast++) {
      if (!cast->converter) {
        swig_type_info *tc = cast->type;
        if (!tc->clientdata) {
          SWIG_TypeClientData(tc, clientdata);
        }
      }
    }
    head = head->next;
  }
}

SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}

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

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
                            swig_module_info *end,
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      size_t l = 0;
      size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  int compare = strcmp(name, iname);
	  if (compare == 0) {
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).

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

  /* neither found a match */
  return 0;
}

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

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

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

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

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

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

#ifdef __cplusplus
}
#endif

/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */
#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


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

#ifdef __cplusplus
extern "C" {
#endif

#include "lua.h"
#include "lauxlib.h"
#include <stdlib.h>  /* for malloc */
#include <assert.h>  /* for a few sanity tests */

/* -----------------------------------------------------------------------------
 * Lua flavors
 * ----------------------------------------------------------------------------- */

#define SWIG_LUA_FLAVOR_LUA 1
#define SWIG_LUA_FLAVOR_ELUA 2
#define SWIG_LUA_FLAVOR_ELUAC 3

#if !defined(SWIG_LUA_TARGET)
# error SWIG_LUA_TARGET not defined
#endif

#if defined(SWIG_LUA_ELUA_EMULATE)

struct swig_elua_entry;

typedef struct swig_elua_key {
  int type;
  union {
    const char* strkey;
    lua_Number numkey;
  } key;
} swig_elua_key;

typedef struct swig_elua_val {
  int type;
  union {
    lua_Number number;
    const struct swig_elua_entry *table;
    const char *string;
    lua_CFunction function;
    struct {
      char member;
      long lvalue;
      void *pvalue;
      swig_type_info **ptype;
    } userdata;
  } value;
} swig_elua_val;

typedef struct swig_elua_entry {
  swig_elua_key key;
  swig_elua_val value;
} swig_elua_entry;

#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
#define LNILKEY {LUA_TNIL, {.strkey = 0} }

#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
#define LROVAL(x) {LUA_TTABLE, {.table = x} }
#define LNILVAL {LUA_TNIL, {.string = 0} }
#define LSTRVAL(x) {LUA_TSTRING, {.string = x} }

#define LUA_REG_TYPE swig_elua_entry

#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"

#define lua_pushrotable(L,p)\
  lua_newtable(L);\
  assert(p);\
  SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));

#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
  LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }

#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
  LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
    /* Those two types of constants are not supported in elua */

#ifndef SWIG_LUA_CONSTTAB_POINTER
#warning eLua does not support pointers as constants. By default, nil will be used as value
#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
#endif

#ifndef SWIG_LUA_CONSTTAB_BINARY
#warning eLua does not support pointers to member as constants. By default, nil will be used as value
#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
#endif
#else /* SWIG_LUA_FLAVOR_LUA */
#  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
#  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
#  define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
       SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
#  define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
       SWIG_LUA_BINARY,  (char *)B, S, 0, (void *)C, &D
#endif

#ifndef SWIG_LUA_ELUA_EMULATE
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
#  define LSTRVAL LRO_STRVAL
#endif
#endif /* SWIG_LUA_ELUA_EMULATE*/

#ifndef SWIG_LUA_ELUA_EMULATE
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)

#ifndef MIN_OPT_LEVEL
#define MIN_OPT_LEVEL 2
#endif

#include "lrodefs.h"
#include "lrotable.h"
#endif
#endif /* SWIG_LUA_ELUA_EMULATE*/
/* -----------------------------------------------------------------------------
 * compatibility defines
 * ----------------------------------------------------------------------------- */

/* History of Lua C API length functions:  In Lua 5.0 (and before?)
   there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
   but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
   this function was again renamed, to "lua_rawlen" (to emphasize that
   it doesn't call the "__len" metamethod), and the compatibility
   define of lua_strlen was removed.  All SWIG uses have been updated
   to "lua_rawlen", and we add our own defines of that here for older
   versions of Lua.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
# define lua_rawlen lua_strlen
#elif LUA_VERSION_NUM == 501
# define lua_rawlen lua_objlen
#endif

/* lua_tolstring() was added in Lua 5.1.  It should be a little more
   efficient than making two separate calls and it avoids problems with order
   of evaluation so SWIG calls lua_tolstring() when it wants the length and
   we provide a compatibility implementation for Lua 5.0.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
static const char *(lua_tolstring)(lua_State *L, int idx, size_t *len) {
  /* Call lua_tostring() first as it may convert the value from number to
     string. */
  const char *result = lua_tostring(L, idx);
  if (len) *len = lua_strlen(L, idx);
  return result;
}
#endif


/* lua_pushglobaltable is the recommended "future-proof" way to get
   the global table for Lua 5.2 and later.  Here we define
   lua_pushglobaltable ourselves for Lua versions before 5.2.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
#endif

/* lua_absindex was introduced in Lua 5.2 */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
#endif

/* lua_rawsetp was introduced in Lua 5.2 */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
#define lua_rawsetp(L,index,ptr)\
  lua_pushlightuserdata(L,(void*)(ptr));\
  lua_insert(L,-2);\
  lua_rawset(L,index);

#define lua_rawgetp(L,index,ptr)\
  lua_pushlightuserdata(L,(void*)(ptr));\
  lua_rawget(L,index);

#endif

/* --------------------------------------------------------------------------
 * Helper functions for error handling
 * -------------------------------------------------------------------------- */

/* Push the string STR on the Lua stack, like lua_pushstring, but
   prefixed with the location of the innermost Lua call-point
   (as formatted by luaL_where).  */
SWIGRUNTIME void
SWIG_Lua_pusherrstring (lua_State *L, const char *str)
{
  luaL_where (L, 1);
  lua_pushstring (L, str);
  lua_concat (L, 2);
}

/* Push a formatted string generated from FMT and following args on
   the Lua stack, like lua_pushfstring, but prefixed with the
   location of the innermost Lua call-point (as formatted by luaL_where).  */
SWIGRUNTIME void
SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
{
  va_list argp;
  va_start(argp, fmt);
  luaL_where(L, 1);
  lua_pushvfstring(L, fmt, argp);
  va_end(argp);
  lua_concat(L, 2);
}


/* -----------------------------------------------------------------------------
 * global swig types
 * ----------------------------------------------------------------------------- */
/* Constant table */
#define SWIG_LUA_INT     1
#define SWIG_LUA_FLOAT   2
#define SWIG_LUA_STRING  3
#define SWIG_LUA_POINTER 4
#define SWIG_LUA_BINARY  5
#define SWIG_LUA_CHAR    6

/* Structure for variable linking table */
typedef struct {
  const char *name;
  lua_CFunction get;
  lua_CFunction set;
} swig_lua_var_info;

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
typedef const LUA_REG_TYPE swig_lua_method;
typedef const LUA_REG_TYPE swig_lua_const_info;
#else /* Normal lua */
typedef luaL_Reg swig_lua_method;

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

#endif

typedef struct {
  const char     *name;
  lua_CFunction   getmethod;
  lua_CFunction   setmethod;
} swig_lua_attribute;


struct swig_lua_class;
/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */
typedef struct swig_lua_namespace {
  const char            *name;
  swig_lua_method       *ns_methods;
  swig_lua_attribute    *ns_attributes;
  swig_lua_const_info   *ns_constants;
  struct swig_lua_class        **ns_classes;
  struct swig_lua_namespace    **ns_namespaces;
} swig_lua_namespace;

typedef struct swig_lua_class {
  const char    *name; /* Name that this class has in Lua */
  const char    *fqname; /* Fully qualified name - Scope + class name */
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  swig_lua_namespace    *cls_static;
  swig_lua_method   *metatable; /* 0 for -eluac */
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

/* this is the struct for wrapping all pointers in SwigLua
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  void        *ptr;
} swig_lua_userdata;

/* this is the struct for wrapping arbitrary packed binary data
(currently it is only used for member function pointers)
the data ordering is similar to swig_lua_userdata, but it is currently not possible
to tell the two structures apart within SWIG, other than by looking at the type
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  char data[1];       /* arbitrary amount of data */
} swig_lua_rawdata;

/* Common SWIG API */
#define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
#define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
#define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)

/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*

/* Contract support */
#define SWIG_contract_assert(expr, msg)  \
  do { if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } } while (0)


/* helper #defines */
#define SWIG_fail {goto fail;}
#define SWIG_fail_arg(func_name,argnum,type) \
  {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
  func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
  goto fail;}
#define SWIG_fail_ptr(func_name,argnum,type) \
  SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
#define SWIG_check_num_args(func_name,a,b) \
  if (lua_gettop(L)<a || lua_gettop(L)>b) \
  {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
  goto fail;}


#define SWIG_Lua_get_table(L,n) \
  (lua_pushstring(L, n), lua_rawget(L,-2))

#define SWIG_Lua_add_function(L,n,f) \
  (lua_pushstring(L, n), \
      lua_pushcfunction(L, f), \
      lua_rawset(L,-3))

#define SWIG_Lua_add_boolean(L,n,b) \
  (lua_pushstring(L, n), \
      lua_pushboolean(L, b), \
      lua_rawset(L,-3))

/* special helper for allowing 'nil' for usertypes */
#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))

#ifdef __cplusplus
/* Special helper for member function pointers
it gets the address, casts it, then dereferences it */
/*#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a))) */
#endif

/* storing/access of swig_module_info */
SWIGRUNTIME swig_module_info *
SWIG_Lua_GetModule(lua_State *L) {
  swig_module_info *ret = 0;
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_rawget(L,LUA_REGISTRYINDEX);
  if (lua_islightuserdata(L,-1))
    ret=(swig_module_info*)lua_touserdata(L,-1);
  lua_pop(L,1);  /* tidy */
  return ret;
}

SWIGRUNTIME void
SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) {
  /* add this all into the Lua registry: */
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_pushlightuserdata(L,(void*)module);
  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* -----------------------------------------------------------------------------
 * global variable support code: modules
 * ----------------------------------------------------------------------------- */

/* this function is called when trying to set an immutable.
default action is to print an error.
This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L)
{
/*  there should be 1 param passed in: the new value */
#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
  lua_pop(L,1);  /* remove it */
  luaL_error(L,"This variable is immutable");
#endif
    return 0;   /* should not return anything */
}

#ifdef SWIG_LUA_ELUA_EMULATE

SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own);
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type);
static int swig_lua_elua_emulate_unique_key;

/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */
SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table)
{
  int i, table_parsed, parsed_tables_array, target_table;
  assert(lua_istable(L,-1));
  target_table = lua_gettop(L);
  /* Get the registry where we put all parsed tables to avoid loops */
  lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
  if(lua_isnil(L,-1)) {
    lua_pop(L,1);
    lua_newtable(L);
    lua_pushvalue(L,-1);
    lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key));
  }
  parsed_tables_array = lua_gettop(L);
  lua_pushvalue(L,target_table);
  lua_rawsetp(L, parsed_tables_array, table);
  table_parsed = 0;
  const int SWIGUNUSED pairs_start = lua_gettop(L);
  for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
  {
    const swig_elua_entry *entry = table + i;
    int is_metatable = 0;
    switch(entry->key.type) {
      case LUA_TSTRING:
        lua_pushstring(L,entry->key.key.strkey);
        if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
          is_metatable = 1;
        break;
      case  LUA_TNUMBER:
        lua_pushnumber(L,entry->key.key.numkey);
        break;
      case LUA_TNIL:
        lua_pushnil(L);
        break;
      default:
        assert(0);
    }
    switch(entry->value.type) {
      case LUA_TSTRING:
        lua_pushstring(L,entry->value.value.string);
        break;
      case  LUA_TNUMBER:
        lua_pushnumber(L,entry->value.value.number);
        break;
      case LUA_TFUNCTION:
        lua_pushcfunction(L,entry->value.value.function);
        break;
      case LUA_TTABLE:
        lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
        table_parsed = !lua_isnil(L,-1);
        if(!table_parsed) {
          lua_pop(L,1); /*remove nil */
          lua_newtable(L);
          SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
        }
        if(is_metatable) {
          assert(lua_istable(L,-1));
          lua_pushvalue(L,-1);
          lua_setmetatable(L,target_table);
        }

        break;
      case LUA_TUSERDATA:
        if(entry->value.value.userdata.member)
          SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue,
              entry->value.value.userdata.lvalue,
              *(entry->value.value.userdata.ptype));
        else
          SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue,
              *(entry->value.value.userdata.ptype),0);
        break;
      case LUA_TNIL:
        lua_pushnil(L);
        break;
      default:
        assert(0);
    }
    assert(lua_gettop(L) == pairs_start + 2);
    lua_rawset(L,target_table);
  }
  lua_pop(L,1); /* Removing parsed tables storage */
  assert(lua_gettop(L) == target_table);
}

SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
{
  lua_pushnil(L);
  lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
}

SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L);

SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
{
  SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1);
  SWIG_Lua_get_class_registry(L);
  lua_getfield(L,-1,"lua_getmetatable");
  lua_remove(L,-2); /* remove the registry*/
  assert(!lua_isnil(L,-1));
  lua_pushvalue(L,1);
  assert(lua_gettop(L) == 3); /* object | function | object again */
  lua_call(L,1,1);
  if(!lua_isnil(L,-1)) /*There is an ordinary metatable */
    return 1;
  /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/
  assert(lua_gettop(L) == 2);
  if(lua_istable(L,-2)) {
    lua_pop(L,1); /*remove the nil*/
    lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
  }
  assert(lua_gettop(L) == 2);
  return 1;

fail:
  lua_error(L);
  return 0;
}

SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
{
  SWIG_Lua_get_class_registry(L);
  lua_pushglobaltable(L);
  lua_pushstring(L,"lua_getmetatable");
  lua_getfield(L,-2,"getmetatable");
  assert(!lua_isnil(L,-1));
  lua_rawset(L,-4);
  lua_pushstring(L, "getmetatable");
  lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
  lua_rawset(L,-3);
  lua_pop(L,2);

}
/* END OF REMOVE */

#endif
/* -----------------------------------------------------------------------------
 * global variable support code: namespaces and modules (which are the same thing)
 * ----------------------------------------------------------------------------- */

SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_istable(L,-2));  /* just in case */
  lua_getmetatable(L,-2);
  assert(lua_istable(L,-1));
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));
  /* look for the key in the .get table */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_call(L,0,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  return 0;
}

SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
*/

  assert(lua_istable(L,1));
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));

  SWIG_Lua_get_table(L,".set"); /* find the .set table */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
    lua_pop(L,1);  /* remove the value */
  }
  lua_pop(L,1);  /* remove the value .set table */
  lua_pop(L,1); /* remote metatable */
  lua_rawset(L,-3);
  return 0;
}

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */
SWIGINTERN void  SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */
SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss);

/* helper function - register namespace methods and attributes into namespace */
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
{
  int i;
  /* There must be namespace table (not metatable) at the top of the stack */
  assert(lua_istable(L,-1));
  SWIG_Lua_InstallConstants(L, ns->ns_constants);

  /* add methods to the namespace/module table */
  for(i=0;ns->ns_methods[i].name;i++){
    SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func);
  }
  lua_getmetatable(L,-1);

  /* add fns */
  for(i=0;ns->ns_attributes[i].name;i++){
    SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
  }

  /* clear stack - remove metatble */
  lua_pop(L,1);
  return 0;
}

/* Register all classes in the namespace */
SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
{
  swig_lua_class **classes;

  /* There must be a module/namespace table at the top of the stack */
  assert(lua_istable(L,-1));

  classes = ns->ns_classes;

  if( classes != 0 ) {
    while(*classes != 0) {
      SWIG_Lua_class_register(L, *classes);
      classes++;
    }
  }
}

/* Helper function. Creates namespace table and adds it to module table
   if 'reg' is true, then will register namespace table to parent one (must be on top of the stack
   when function is called).
   Function always returns newly registered table on top of the stack.
*/
SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
{
  swig_lua_namespace **sub_namespace;
  /* 1 argument - table on the top of the stack */
  const int SWIGUNUSED begin = lua_gettop(L);
  assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */
  lua_checkstack(L,5);
  lua_newtable(L); /* namespace itself */
  lua_newtable(L); /* metatable for namespace */

  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  lua_rawset(L,-3);

  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);

  lua_setmetatable(L,-2); /* set metatable */

  /* Register all functions, variables etc */
  SWIG_Lua_add_namespace_details(L,ns);
  /* Register classes */
  SWIG_Lua_add_namespace_classes(L,ns);

  sub_namespace = ns->ns_namespaces;
  if( sub_namespace != 0) {
    while(*sub_namespace != 0) {
      SWIG_Lua_namespace_register(L, *sub_namespace, 1);
      lua_pop(L,1); /* removing sub-namespace table */
      sub_namespace++;
    }
  }

  if (reg) {
    lua_pushstring(L,ns->name);
    lua_pushvalue(L,-2);
    lua_rawset(L,-4); /* add namespace to module table */
  }
  assert(lua_gettop(L) == begin+1);
}
#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */

/* -----------------------------------------------------------------------------
 * global variable support code: classes
 * ----------------------------------------------------------------------------- */

SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State *L,const char *cname);

typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret);

SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type,
  int first_arg, swig_lua_base_iterator_func func, int  *const ret)
{
    /* first_arg - position of the object in stack. Everything that is above are arguments
     * and is passed to every evocation of the func */
    int last_arg = lua_gettop(L);/* position of last argument */
    int original_metatable = last_arg + 1;
    size_t bases_count;
    int result = SWIG_ERROR;
    int bases_table;
    (void)swig_type;
    lua_getmetatable(L,first_arg);

    /* initialise base search */
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
    SWIG_Lua_get_table(L,".bases");
    assert(lua_istable(L,-1));
    bases_count = lua_rawlen(L,-1);
    bases_table = lua_gettop(L);
#else
    /* In elua .bases table doesn't exist. Use table from swig_lua_class */
    (void)bases_table;
    assert(swig_type!=0);
    swig_module_info *module=SWIG_GetModule(L);
    swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases;
    const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names;
    bases_count = 0;
    for(;base_names[bases_count];
      bases_count++);/* get length of bases */
#endif

    if(ret)
      *ret = 0;
    if(bases_count>0)
    {
      int to_remove;
      size_t i;
      int j;
      int subcall_last_arg;
      int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */
      int valid = 1;
      swig_type_info *base_swig_type = 0;
      for(j=first_arg;j<=last_arg;j++)
        lua_pushvalue(L,j);
      subcall_last_arg = lua_gettop(L);

      /* Trick: temporarily replacing original metatable with metatable for base class and call getter */
      for(i=0;i<bases_count;i++) {
        /* Iteration through class bases */
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
        lua_rawgeti(L,bases_table,i+1);
        base_swig_type = 0;
        if(lua_isnil(L,-1)) {
          valid = 0;
          lua_pop(L,1);
        } else {
          valid = 1;
        }
#else /* In elua .bases table doesn't exist. Use table from swig_lua_class */
        swig_lua_class *base_class = bases[i];
        if(!base_class) {
          valid = 0;
        } else {
          valid = 1;
          SWIG_Lua_get_class_metatable(L,base_class->fqname);
          base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]);
          assert(base_swig_type != 0);
        }
#endif

        if(!valid)
          continue;
        assert(lua_isuserdata(L, subcall_first_arg));
        assert(lua_istable(L,-1));
        lua_setmetatable(L,subcall_first_arg); /* Set new metatable */
        assert(lua_gettop(L) == subcall_last_arg);
        result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */
        if(result != SWIG_ERROR) {
          break;
        }
      }
      /* Restore original metatable */
      lua_pushvalue(L,original_metatable);
      lua_setmetatable(L,first_arg);
      /* Clear - remove everything between last_arg and subcall_last_arg including */
      to_remove = subcall_last_arg - last_arg;
      for(j=0;j<to_remove;j++)
        lua_remove(L,last_arg+1);
    } else {
      /* Remove everything after last_arg */
      lua_pop(L, lua_gettop(L) - last_arg);
    }
    if(ret) assert(lua_gettop(L) == last_arg + *ret);
    return result;
}

/* The class.get method helper, performs the lookup of class attributes.
 * It returns an error code. Number of function return values is passed inside 'ret'.
 * first_arg is not used in this function because function always has 2 arguments.
 */
SWIGINTERN int  SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  int bases_search_result;
  int substack_start = lua_gettop(L)-2;
  assert(first_arg == substack_start+1);
  (void)first_arg;
  lua_checkstack(L,5);
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  /* NEW: looks for the __getitem() fn
  this is a user provided get fn */
  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  if (lua_iscfunction(L,-1))  /* if it's there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,substack_start+1);  /* the userdata */
    lua_pushvalue(L,substack_start+2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    if(ret) *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);
  /* Remove the metatable */
  lua_pop(L,1);
  /* Search in base classes */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get_item,ret);
  return bases_search_result;  /* sorry not known */
}


/* The class.get method helper, performs the lookup of class attributes.
 * It returns an error code. Number of function return values is passed inside 'ret'.
 * first_arg is not used in this function because function always has 2 arguments.
 */
SWIGINTERN int  SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  int bases_search_result;
  int substack_start = lua_gettop(L)-2;
  assert(first_arg == substack_start+1);
  (void)first_arg;
  lua_checkstack(L,5);
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  /* look for the key in the .get table */
  lua_pushvalue(L,substack_start+2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,substack_start+1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    if(ret)
      *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,substack_start+2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: if it's a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    if(ret)
      *ret = 1;
    return SWIG_OK;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* Remove the metatable */
  lua_pop(L,1);
  /* Search in base classes */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get,ret);
  return bases_search_result;  /* sorry not known */
}

/* the class.get method, performs the lookup of class attributes
 */
SWIGINTERN int  SWIG_Lua_class_get(lua_State *L)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  int result;
  swig_lua_userdata *usr;
  swig_type_info *type;
  int ret = 0;
  assert(lua_isuserdata(L,1));
  usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  type = usr->type;
  result = SWIG_Lua_class_do_get(L,type,1,&ret);
  if(result == SWIG_OK)
    return ret;

  result = SWIG_Lua_class_do_get_item(L,type,1,&ret);
  if(result == SWIG_OK)
    return ret;

  return 0;
}

/* helper for the class.set method, performs the lookup of class attributes
 * It returns error code. Number of function return values is passed inside 'ret'
 */
SWIGINTERN int  SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
  */

  int bases_search_result;
  int substack_start = lua_gettop(L) - 3;
  lua_checkstack(L,5);
  assert(lua_isuserdata(L,substack_start+1));  /* just in case */
  lua_getmetatable(L,substack_start+1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  if(ret)
    *ret = 0; /* it is setter - number of return values is always 0 */

  SWIG_Lua_get_table(L,".set"); /* find the .set table */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,substack_start+2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,-2); /* tidy stack, remove .set table */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,substack_start+1);  /* userdata */
      lua_pushvalue(L,substack_start+3);  /* value */
      lua_call(L,2,0);
      lua_remove(L,substack_start+4); /*remove metatable*/
      return SWIG_OK;
    }
    lua_pop(L,1);  /* remove the value */
  } else {
    lua_pop(L,1);  /* remove the answer for .set table request*/
  }
  /* NEW: looks for the __setitem() fn
  this is a user provided set fn */
  SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
  if (lua_iscfunction(L,-1))  /* if it's there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,substack_start+1);  /* the userdata */
    lua_pushvalue(L,substack_start+2);  /* the parameter */
    lua_pushvalue(L,substack_start+3);  /* the value */
    lua_call(L,3,0);  /* 3 values in ,0 out */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return SWIG_OK;
  }
  lua_pop(L,1); /* remove value */

  lua_pop(L,1); /* remove metatable */
  /* Search among bases */
  bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret);
  if(ret)
    assert(*ret == 0);
  assert(lua_gettop(L) == substack_start + 3);
  return bases_search_result;
}

/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly
 * handles return values.
 */
SWIGINTERN int  SWIG_Lua_class_set(lua_State *L)
{
/*  There should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
  */
  int ret = 0;
  int result;
  swig_lua_userdata *usr;
  swig_type_info *type;
  assert(lua_isuserdata(L,1));
  usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  type = usr->type;
  result = SWIG_Lua_class_do_set(L,type,1,&ret);
  if(result != SWIG_OK) {
   SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
   lua_error(L);
  } else {
    assert(ret==0);
  }
  return 0;
}

/* the class.destruct method called by the interpreter */
SWIGINTERN int  SWIG_Lua_class_destruct(lua_State *L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata *usr;
  swig_lua_class *clss;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  /* if must be destroyed & has a destructor */
  if (usr->own) /* if must be destroyed */
  {
    clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
    if (clss && clss->destructor)  /* there is a destroy fn */
    {
      clss->destructor(usr->ptr);  /* bye bye */
    }
  }
  return 0;
}

/* the class.__tostring method called by the interpreter and print */
SWIGINTERN int  SWIG_Lua_class_tostring(lua_State *L)
{
/*  there should be 1 param passed in
  (1) userdata (not the metatable) */
  swig_lua_userdata* userData;
  assert(lua_isuserdata(L,1));  /* just in case */
  userData = (swig_lua_userdata*)lua_touserdata(L,1); /* get the userdata address */

  lua_pushfstring(L, "<userdata of type '%s' at %p>", userData->type->str, userData->ptr);
  return 1;
}

/* to manually disown some userdata */
SWIGINTERN int  SWIG_Lua_class_disown(lua_State *L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata *usr;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */

  usr->own = 0; /* clear our ownership */
  return 0;
}

/* lua callable function to compare userdata's value
the issue is that two userdata may point to the same thing
but to lua, they are different objects */
SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
{
  int result;
  swig_lua_userdata *usr1,*usr2;
  if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
    return 0;  /* nil reply */
  usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
  /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
  result=(usr1->ptr==usr2->ptr);
   lua_pushboolean(L,result);
  return 1;
}

/* populate table at the top of the stack with metamethods that ought to be inherited */
SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
{
  SWIG_Lua_add_boolean(L, "__add", 1);
  SWIG_Lua_add_boolean(L, "__sub", 1);
  SWIG_Lua_add_boolean(L, "__mul", 1);
  SWIG_Lua_add_boolean(L, "__div", 1);
  SWIG_Lua_add_boolean(L, "__mod", 1);
  SWIG_Lua_add_boolean(L, "__pow", 1);
  SWIG_Lua_add_boolean(L, "__unm", 1);
  SWIG_Lua_add_boolean(L, "__len", 1 );
  SWIG_Lua_add_boolean(L, "__concat", 1 );
  SWIG_Lua_add_boolean(L, "__eq", 1);
  SWIG_Lua_add_boolean(L, "__lt", 1);
  SWIG_Lua_add_boolean(L, "__le", 1);
  SWIG_Lua_add_boolean(L, "__call", 1);
  SWIG_Lua_add_boolean(L, "__tostring", 1);
  SWIG_Lua_add_boolean(L, "__gc", 0);
}

/* creates the swig registry */
SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
{
  /* create main SWIG registry table */
  lua_pushstring(L,"SWIG");
  lua_newtable(L);
  /* populate it with some predefined data */

  /* .library table. Placeholder */
  lua_pushstring(L,".library");
  lua_newtable(L);
  {
    /* list of metamethods that class inherits from its bases */
    lua_pushstring(L,"inheritable_metamethods");
    lua_newtable(L);
    /* populate with list of metamethods */
    SWIG_Lua_populate_inheritable_metamethods(L);
    lua_rawset(L,-3);
  }
  lua_rawset(L,-3);

  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* gets the swig registry (or creates it) */
SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State *L)
{
  /* add this all into the swig registry: */
  lua_pushstring(L,"SWIG");
  lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
  if (!lua_istable(L,-1))  /* not there */
  {  /* must be first time, so add it */
    lua_pop(L,1);  /* remove the result */
    SWIG_Lua_create_class_registry(L);
    /* then get it */
    lua_pushstring(L,"SWIG");
    lua_rawget(L,LUA_REGISTRYINDEX);
  }
}

SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
{
  SWIG_Lua_get_class_registry(L);
  lua_pushstring(L, ".library");
  lua_rawget(L,-2);
  assert( !lua_isnil(L,-1) );
  lua_pushstring(L, "inheritable_metamethods");
  lua_rawget(L,-2);

  /* Remove class registry and library table */
  lua_remove(L,-2);
  lua_remove(L,-2);
}

/* Helper function to get the classes metatable from the register */
SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State *L,const char *cname)
{
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,cname);  /* get the name */
  lua_rawget(L,-2);    /* get it */
  lua_remove(L,-2);    /* tidy up (remove registry) */
}

/* Set up the base classes pointers.
Each class structure has a list of pointers to the base class structures.
This function fills them.
It cannot be done at compile time, as this will not work with hireachies
spread over more than one swig file.
Therefore it must be done at runtime, querying the SWIG type system.
*/
SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
{
  int i=0;
  swig_module_info *module=SWIG_GetModule(L);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* not found yet */
    {
      /* lookup and cache the base class */
      swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
      if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
    }
  }
}

#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
/* Merges two tables  */
SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
{
  /* iterating */
  lua_pushnil(L);
  while (lua_next(L,source) != 0) {
    /* -1 - value, -2 - index */
    /* have to copy to assign */
    lua_pushvalue(L,-2); /* copy of index */
    lua_pushvalue(L,-2); /* copy of value */
    lua_rawset(L, target);
    lua_pop(L,1);
    /* only key is left */
  }
}

/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
{
  /* push original[name], then base[name] */
  lua_pushstring(L,name);
  lua_rawget(L,original);
  int original_table = lua_gettop(L);
  lua_pushstring(L,name);
  lua_rawget(L,base);
  int base_table = lua_gettop(L);
  SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
  /* clearing stack */
  lua_pop(L,2);
}

/* Function takes all symbols from base and adds it to derived class. It's just a helper. */
SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
{
  /* There is one parameter - original, i.e. 'derived' class metatable */
  assert(lua_istable(L,-1));
  int original = lua_gettop(L);
  SWIG_Lua_get_class_metatable(L,base_cls->fqname);
  int base = lua_gettop(L);
  SWIG_Lua_merge_tables(L, ".fn", original, base );
  SWIG_Lua_merge_tables(L, ".set", original, base );
  SWIG_Lua_merge_tables(L, ".get", original, base );
  lua_pop(L,1);
}

/* Function squashes all symbols from 'clss' bases into itself */
SWIGINTERN void  SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
{
  int i;
  SWIG_Lua_get_class_metatable(L,clss->fqname);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* Somehow it's not found. Skip it */
      continue;
    /* Thing is: all bases are already registered. Thus they have already executed
     * this function. So we just need to squash them into us, because their bases
     * are already squashed into them. No need for recursion here!
     */
    SWIG_Lua_class_squash_base(L, clss->bases[i]);
  }
  lua_pop(L,1); /*tidy stack*/
}
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
/* helper add a variable to a registered class */
SWIGINTERN void  SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* just in case */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
}

/* helper to recursively add class static details (static attributes, operations and constants) */
SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
{
  int i = 0;
  /* The class namespace table must be on the top of the stack */
  assert(lua_istable(L,-1));
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_static_details(L,clss->bases[i]);
  }

  SWIG_Lua_add_namespace_details(L, clss->cls_static);
}

SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
{
  int i;
  size_t bases_count = 0;
  /* Add bases to .bases table */
  SWIG_Lua_get_table(L,".bases");
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
    /* Base class must be already registered */
    assert(lua_istable(L,-1));
    lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */
    bases_count++;
  }
  assert(lua_rawlen(L,-1) == bases_count);
  lua_pop(L,1); /* remove .bases table */
  /* add attributes */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  }
  /* add methods to the metatable */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->methods[i].name;i++){
    SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /* add operator overloads
    This adds methods from metatable array to metatable. Can mess up garbage
    collectind if someone defines __gc method
    */
  if(clss->metatable) {
    for(i=0;clss->metatable[i].name;i++) {
      SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func);
    }
  }

#if !defined(SWIG_LUA_SQUASH_BASES)
  /* Adding metamethods that are defined in base classes. If bases were squashed
   * then it is obviously unnecessary
   */
  SWIG_Lua_add_class_user_metamethods(L, clss);
#endif
}

/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed
   for the following issue: Lua runtime checks for metamethod existence with rawget function
   ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method
   search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly
   in metatable and not in object).
   Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants
   are automatically given a special proxy __x that calls the real __x method.
   Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime,
   those changes must be reflected in all descendants.
*/

SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/

/* The real function that resolves a metamethod.
 * Function searches given class and all its bases (recursively) for first instance of something that is
 * not equal to SWIG_Lua_resolve_metamethod. (Almost always this 'something' is actual metamethod implementation
 * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
 * answer.
 * Returns 1 if found, 0 otherwise.
 * clss is class which metatable we will search for method
 * metamethod_name_idx is index in L where metamethod name (as string) lies
 * skip_check allows skipping searching metamethod in the given class and immediately going to searching in bases. skip_check
 * is not carried to subsequent recursive calls - false is always passed. It is set to true only at first call from
 * SWIG_Lua_resolve_metamethod
 * */
SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx,
    int skip_check)
{
  /* This function is called recursively */
  int result = 0;
  int i = 0;

  if (!skip_check) {
    SWIG_Lua_get_class_metatable(L, clss->fqname);
    lua_pushvalue(L, metamethod_name_idx);
    lua_rawget(L,-2);
    /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then
     * this isn't the function we are looking for :)
     * lua_tocfunction will return NULL if not cfunction
     */
    if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) {
      lua_remove(L,-2); /* removing class metatable */
      return 1;
    }
    lua_pop(L,2); /* remove class metatable and query result */
  }

  /* Forwarding calls to bases */
  for(i=0;clss->bases[i];i++)
  {
    result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0);
    if (result)
      break;
  }

  return result;
}

/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method
 * and calls it */
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
{
  int numargs;
  int metamethod_name_idx;
  const swig_lua_class* clss;
  int result;

  lua_checkstack(L,5);
  numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */

  /* Get upvalues from closure */
  lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/
  metamethod_name_idx = lua_gettop(L);

  lua_pushvalue(L, lua_upvalueindex(2));
  clss = (const swig_lua_class*)(lua_touserdata(L,-1));
  lua_pop(L,1); /* remove lightuserdata with clss from stack */

  /* Actual work */
  result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1);
  if (!result) {
   SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
   lua_error(L);
   return 0;
  }

  lua_remove(L,-2); /* remove metamethod key */
  lua_insert(L,1); /* move function to correct position */
  lua_call(L, numargs, LUA_MULTRET);
  return lua_gettop(L); /* return all results */
}


/* If given metamethod must be present in given class, then creates appropriate proxy
 * Returns 1 if successfully added, 0 if not added because no base class has it, -1
 * if method is defined in the class metatable itself
 */
SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
{
  int key_index;
  int success = 0;
  int i = 0;

  /* metamethod name - on the top of the stack */
  assert(lua_isstring(L,-1));

  key_index = lua_gettop(L);

  /* Check whether method is already defined in metatable */
  lua_pushvalue(L,key_index); /* copy of the key */
  lua_gettable(L,metatable_index);
  if( !lua_isnil(L,-1) ) {
    lua_pop(L,1);
    return -1;
  }
  lua_pop(L,1);

  /* Iterating over immediate bases */
  for(i=0;clss->bases[i];i++)
  {
    const swig_lua_class *base = clss->bases[i];
    SWIG_Lua_get_class_metatable(L, base->fqname);
    lua_pushvalue(L, key_index);
    lua_rawget(L, -2);
    if( !lua_isnil(L,-1) ) {
      lua_pushvalue(L, key_index);

      /* Add proxy function */
      lua_pushvalue(L, key_index); /* first closure value is function name */
      lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */
      lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2);

      lua_rawset(L, metatable_index);
      success = 1;
    }
    lua_pop(L,1); /* remove function or nil */
    lua_pop(L,1); /* remove base class metatable */

    if( success )
      break;
  }

  return success;
}

SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
{
  int metatable_index;
  int metamethods_info_index;
  int tostring_undefined;
  int eq_undefined = 0;

  SWIG_Lua_get_class_metatable(L, clss->fqname);
  metatable_index = lua_gettop(L);
  SWIG_Lua_get_inheritable_metamethods(L);
  assert(lua_istable(L,-1));
  metamethods_info_index = lua_gettop(L);
  lua_pushnil(L); /* first key */
  while(lua_next(L, metamethods_info_index) != 0 ) {
    /* key at index -2, value at index -1 */
    const int is_inheritable = lua_toboolean(L,-2);
    lua_pop(L,1); /* remove value - we don't need it anymore */

    if(is_inheritable) { /* if metamethod is inheritable */
      SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index);
    }
  }

  lua_pop(L,1); /* remove inheritable metamethods table */

  /* Special handling for __tostring method */
  lua_pushstring(L, "__tostring");
  lua_pushvalue(L,-1);
  lua_rawget(L,metatable_index);
  tostring_undefined = lua_isnil(L,-1);
  lua_pop(L,1);
  if( tostring_undefined ) {
    lua_pushcfunction(L, SWIG_Lua_class_tostring);
    lua_rawset(L, metatable_index);
  } else {
    lua_pop(L,1); /* remove copy of the key */
  }

  /* Special handling for __eq method */
  lua_pushstring(L, "__eq");
  lua_pushvalue(L,-1);
  lua_rawget(L,metatable_index);
  eq_undefined = lua_isnil(L,-1);
  lua_pop(L,1);
  if( eq_undefined ) {
    lua_pushcfunction(L, SWIG_Lua_class_equal);
    lua_rawset(L, metatable_index);
  } else {
    lua_pop(L,1); /* remove copy of the key */
  }
  /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[]
   * a __getitem/__setitem method should be defined
   */
  lua_pop(L,1); /* pop class metatable */
}

/* Register class static methods,attributes etc as well as constructor proxy */
SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  lua_checkstack(L,5); /* just in case */
  assert(lua_istable(L,-1));  /* just in case */
  assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */

  SWIG_Lua_namespace_register(L,clss->cls_static, 1);

  assert(lua_istable(L,-1)); /* just in case */

  /*  add its constructor to module with the name of the class
  so you can do MyClass(...) as well as new_MyClass(...)
  BUT only if a constructor is defined
  (this overcomes the problem of pure virtual classes without constructors)*/
  if (clss->constructor)
  {
    lua_getmetatable(L,-1);
    assert(lua_istable(L,-1)); /* just in case */
    SWIG_Lua_add_function(L,"__call", clss->constructor);
    lua_pop(L,1);
  }

  assert(lua_istable(L,-1)); /* just in case */
  SWIG_Lua_add_class_static_details(L, clss);

  /* clear stack */
  lua_pop(L,1);
  assert( lua_gettop(L) == begin );
}

/* Performs the instance (non-static) class registration process. Metatable for class is created
 * and added to the class registry.
 */
SWIGINTERN void  SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  int i;
  /* if name already there (class is already registered) then do nothing */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_rawget(L,-2);
  if(!lua_isnil(L,-1)) {
    lua_pop(L,2);
    assert(lua_gettop(L)==begin);
    return;
  }
  lua_pop(L,2); /* tidy stack */
  /* Recursively initialize all bases */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_class_register_instance(L,clss->bases[i]);
  }
  /* Again, get registry and push name */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_newtable(L);    /* create the metatable */
#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  /* If squashing is requested, then merges all bases metatable into this one.
   * It would get us all special methods: __getitem, __add etc.
   * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away
   */
  {
    int new_metatable_index = lua_absindex(L,-1);
    for(i=0;clss->bases[i];i++)
    {
      int base_metatable;
      SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
      base_metatable = lua_absindex(L,-1);
      SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
      lua_pop(L,1);
    }
  }
  /* And now we will overwrite all incorrectly set data */
#endif
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->fqname);
  lua_rawset(L,-3);
  /* add a table called bases */
  lua_pushstring(L,".bases");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  /* add manual disown method */
  SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
  lua_rawset(L,-3);
  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  /* add it */
  lua_rawset(L,-3);  /* metatable into registry */
  lua_pop(L,1);      /* tidy stack (remove registry) */
  assert(lua_gettop(L) == begin);

#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */
  SWIG_Lua_class_squash_bases(L,clss);
#endif
  SWIG_Lua_get_class_metatable(L,clss->fqname);
  SWIG_Lua_add_class_instance_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
  assert( lua_gettop(L) == begin );
}

SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss)
{
  int SWIGUNUSED begin;
  assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */
  SWIG_Lua_class_register_instance(L,clss);
  SWIG_Lua_class_register_static(L,clss);

  /* Add links from static part to instance part and vice versa */
  /* [SWIG registry]                                   [Module]
   *    "MyClass" ----> [MyClass metatable] <=====     "MyClass" -+> [static part]
   *                     ".get" ----> ...        |                |     getmetatable()----|
   *                     ".set" ----> ...        |                |                       |
   *                     ".static" --------------)----------------/           [static part metatable]
   *                                             |                                ".get" --> ...
   *                                             |                                ".set" --> ....
   *                                             |=============================== ".instance"
   */
  begin = lua_gettop(L);
  lua_pushstring(L,clss->cls_static->name);
  lua_rawget(L,-2); /* get class static table */
  assert(lua_istable(L,-1));
  lua_getmetatable(L,-1);
  assert(lua_istable(L,-1)); /* get class static metatable */
  lua_pushstring(L,".instance"); /* prepare key */

  SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */
  assert(lua_istable(L,-1));
  lua_pushstring(L,".static"); /* prepare key */
  lua_pushvalue(L, -4); /* push static class TABLE */
  assert(lua_istable(L,-1));
  lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */
  lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */
  lua_pop(L,2);
  assert(lua_gettop(L) == begin);
}
#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss)
{
  const int SWIGUNUSED begin = lua_gettop(L);
  int i;
  /* if name already there (class is already registered) then do nothing */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  lua_rawget(L,-2);
  if(!lua_isnil(L,-1)) {
    lua_pop(L,2);
    assert(lua_gettop(L)==begin);
    return;
  }
  lua_pop(L,2); /* tidy stack */
  /* Recursively initialize all bases */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_elua_class_register_instance(L,clss->bases[i]);
  }
  /* Again, get registry and push name */
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->fqname);  /* get the name */
  assert(clss->metatable);
  lua_pushrotable(L, (void*)(clss->metatable));    /* create the metatable */
  lua_rawset(L,-3);
  lua_pop(L,1);
  assert(lua_gettop(L) == begin);
}
#endif /* elua && eluac */

/* -----------------------------------------------------------------------------
 * Class/structure conversion fns
 * ----------------------------------------------------------------------------- */

/* helper to add metatable to new lua object */
SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type)
{
  if (type->clientdata)  /* there is clientdata: so add the metatable */
  {
    SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname);
    if (lua_istable(L,-1))
    {
      lua_setmetatable(L,-2);
    }
    else
    {
      lua_pop(L,1);
    }
  }
}

/* pushes a new object into the lua stack */
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own)
{
  swig_lua_userdata *usr;
  if (!ptr){
    lua_pushnil(L);
    return;
  }
  usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
  usr->ptr=ptr;  /* set the ptr */
  usr->type=type;
  usr->own=own;
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  SWIG_Lua_AddMetatable(L,type); /* add metatable */
#endif
}

/* takes a object from the lua stack & converts it into an object of the correct type
 (if possible) */
SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags)
{
  int ret = SWIG_ERROR;
  swig_lua_userdata *usr;
  swig_cast_info *cast;
  /* special case: lua nil => NULL pointer */
  if (lua_isnil(L,index))
  {
    *ptr=0;
    return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
  }
  if (lua_islightuserdata(L,index))
  {
    *ptr=lua_touserdata(L,index);
    return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
  }
  usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
  if (usr)
  {
    if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own)
    {
      return SWIG_ERROR_RELEASE_NOT_OWNED;
    }
    if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
    {
      usr->own = 0;
    }
    if (!type)            /* special cast void*, no casting fn */
    {
      *ptr=usr->ptr;
      ret = SWIG_OK;
    }
    else
    {
      cast=SWIG_TypeCheck(usr->type->name,type); /* performs normal type checking */
      if (cast)
      {
        int newmemory = 0;
        *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
        assert(!newmemory); /* newmemory handling not yet implemented */
        ret = SWIG_OK;
      }
    }
    if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR))
    {
      usr->ptr = 0;
    }
  }
  return ret;
}

SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags,
       int argnum,const char *func_name){
  void *result = 0;
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
    luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
		func_name,(type && type->str)?type->str:"void*",argnum);
  }
  return result;
}

/* pushes a packed userdata. user for member fn pointers only */
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata *raw;
  assert(ptr); /* not acceptable to pass in a NULL value */
  raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
  raw->type=type;
  raw->own=0;
  memcpy(raw->data,ptr,size); /* copy the data */
  SWIG_Lua_AddMetatable(L,type); /* add metatable */
}

/* converts a packed userdata. user for member fn pointers only */
SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata *raw;
  raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
  if (!raw) return SWIG_ERROR;  /* error */
  if (type==0 || type==raw->type) /* void* or identical type */
  {
    memcpy(ptr,raw->data,size); /* copy it */
    return SWIG_OK; /* ok */
  }
  return SWIG_ERROR;  /* error */
}

/* a function to get the typestring of a piece of data */
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
{
  swig_lua_userdata *usr;
  if (lua_isuserdata(L,tp))
  {
    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
    if (usr && usr->type && usr->type->str)
      return usr->type->str;
    return "userdata (unknown type)";
  }
  return lua_typename(L,lua_type(L,tp));
}

/* lua callable function to get the userdata's type */
SWIGRUNTIME int SWIG_Lua_type(lua_State *L)
{
  lua_pushstring(L,SWIG_Lua_typename(L,1));
  return 1;
}

/* -----------------------------------------------------------------------------
 * global variable support code: class/struct typemap functions
 * ----------------------------------------------------------------------------- */

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
/* Install Constants */
SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
  int i;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_LUA_INT:
      lua_pushstring(L,constants[i].name);
      lua_pushinteger(L,(lua_Integer)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_FLOAT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].dvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_CHAR:
      lua_pushstring(L,constants[i].name);
      {
        char c = (char)constants[i].lvalue;
        lua_pushlstring(L,&c,1);
      }
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_STRING:
      lua_pushstring(L,constants[i].name);
      lua_pushstring(L,(char *) constants[i].pvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_POINTER:
      lua_pushstring(L,constants[i].name);
      SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_BINARY:
      lua_pushstring(L,constants[i].name);
      SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
      lua_rawset(L,-3);
      break;
    default:
      break;
    }
  }
}
#endif

/* -----------------------------------------------------------------------------
 * executing lua code from within the wrapper
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
#endif
/* Executes a C string in Lua which is a really simple way of calling lua from C
Unfortunately lua keeps changing its APIs, so we need a conditional compile
In lua 5.0.X it's lua_dostring()
In lua 5.1.X it's luaL_dostring()
*/
SWIGINTERN int
SWIG_Lua_dostring(lua_State *L, const char *str) {
  int ok,top;
  if (str==0 || str[0]==0) return 0; /* nothing to do */
  top=lua_gettop(L); /* save stack */
#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
  ok=luaL_dostring(L,str);	/* looks like this is lua 5.1.X or later, good */
#else
  ok=lua_dostring(L,str);	/* might be lua 5.0.x, using lua_dostring */
#endif
  if (ok!=0) {
    SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
  }
  lua_settop(L,top); /* restore the stack */
  return ok;
}

#ifdef __cplusplus
}
#endif

/* ------------------------------ end luarun.swg  ------------------------------ */

/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */
#define  SWIG_UnknownError    	   -1
#define  SWIG_IOError        	   -2
#define  SWIG_RuntimeError   	   -3
#define  SWIG_IndexError     	   -4
#define  SWIG_TypeError      	   -5
#define  SWIG_DivisionByZero 	   -6
#define  SWIG_OverflowError  	   -7
#define  SWIG_SyntaxError    	   -8
#define  SWIG_ValueError     	   -9
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12
#define  SWIG_NullReferenceError   -13



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

#define SWIGTYPE_p_Alternative swig_types[0]
#define SWIGTYPE_p_Chksum swig_types[1]
#define SWIGTYPE_p_Dataiterator swig_types[2]
#define SWIGTYPE_p_Datamatch swig_types[3]
#define SWIGTYPE_p_Datapos swig_types[4]
#define SWIGTYPE_p_Decision swig_types[5]
#define SWIGTYPE_p_Decisionset swig_types[6]
#define SWIGTYPE_p_Dep swig_types[7]
#define SWIGTYPE_p_Job swig_types[8]
#define SWIGTYPE_p_Pool swig_types[9]
#define SWIGTYPE_p_Pool_repo_iterator swig_types[10]
#define SWIGTYPE_p_Pool_solvable_iterator swig_types[11]
#define SWIGTYPE_p_Problem swig_types[12]
#define SWIGTYPE_p_Queue swig_types[13]
#define SWIGTYPE_p_Repo swig_types[14]
#define SWIGTYPE_p_Repo_solvable_iterator swig_types[15]
#define SWIGTYPE_p_Ruleinfo swig_types[16]
#define SWIGTYPE_p_Selection swig_types[17]
#define SWIGTYPE_p_Solution swig_types[18]
#define SWIGTYPE_p_Solutionelement swig_types[19]
#define SWIGTYPE_p_SolvFp swig_types[20]
#define SWIGTYPE_p_Solver swig_types[21]
#define SWIGTYPE_p_Transaction swig_types[22]
#define SWIGTYPE_p_TransactionClass swig_types[23]
#define SWIGTYPE_p_XRepodata swig_types[24]
#define SWIGTYPE_p_XRule swig_types[25]
#define SWIGTYPE_p_XSolvable swig_types[26]
#define SWIGTYPE_p_int swig_types[27]
#define SWIGTYPE_p_lua_State swig_types[28]
#define SWIGTYPE_p_p_XRule swig_types[29]
#define SWIGTYPE_p_unsigned_char swig_types[30]
#define SWIGTYPE_p_unsigned_int swig_types[31]
static swig_type_info *swig_types[33];
static swig_module_info swig_module = {swig_types, 32, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

#define SWIG_name      "solv"
#define SWIG_init      luaopen_solv
#define SWIG_init_user luaopen_solv_user

#define SWIG_LUACODE   luaopen_solv_luacode

SWIGINTERN
void prep_stashed_lua_var(lua_State* L, char *name, void *ptr)
{
  lua_getglobal(L, "solv"); 
  if (lua_getfield(L, -1, "_stash") == LUA_TNIL) {
    lua_pop(L, 1);
    lua_newtable(L);
    lua_pushvalue(L, -1);
    lua_setfield(L, -3, "_stash");
  }
  lua_remove(L, -2);
  lua_pushfstring(L, "%s:%p", name, ptr);
}

SWIGINTERN
void set_stashed_lua_var(lua_State* L, int idx, char *name, void *ptr)
{
  lua_pushvalue(L, idx);
  prep_stashed_lua_var(L, name, ptr);
  lua_pushvalue(L, -3);
  lua_settable(L, -3);
  lua_pop(L, 2);
}

SWIGINTERN
void get_stashed_lua_var(lua_State* L, char *name, void *ptr)
{
  prep_stashed_lua_var(L, name, ptr);
  lua_gettable(L, -2);
  lua_remove(L, -2);
}

SWIGINTERN
void clr_stashed_lua_var(lua_State* L, char *name, void *ptr)
{
  prep_stashed_lua_var(L, name, ptr);
  lua_pushnil(L);
  lua_settable(L, -3);
  lua_pop(L, 1);
}


typedef struct {
  const void *data;
  size_t len;
} BinaryBlob;



SWIGINTERN int
SWIG_AsVal_int(lua_State* L, int idx, int *val) {
  int ecode = lua_isnumber(L, idx) ? SWIG_OK : SWIG_TypeError;
  if (ecode == SWIG_OK)
    *val = (int)lua_tonumber(L, idx);
  return ecode;
}



#ifdef __cplusplus	/* generic alloc/dealloc fns*/
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	new TYPE[LEN]
#define SWIG_FREE_ARRAY(PTR)		delete[] PTR
#else
#define SWIG_ALLOC_ARRAY(TYPE,LEN) 	(TYPE *)malloc(LEN*sizeof(TYPE))
#define SWIG_FREE_ARRAY(PTR)		free(PTR)
#endif
/* counting the size of arrays:*/
SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
{
	int n=0;
	while(1){
		lua_rawgeti(L,index,n+1);
		if (lua_isnil(L,-1))break;
		++n;
		lua_pop(L,1);
	}
	lua_pop(L,1);
	return n;
}

SWIGINTERN int SWIG_table_size(lua_State* L, int index)
{
	int n=0;
	lua_pushnil(L);  /* first key*/
	while (lua_next(L, index) != 0) {
		++n;
		lua_pop(L, 1);  /* removes `value'; keeps `key' for next iteration*/
	}
	return n;
}

/* super macro to declare array typemap helper fns */
#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
	SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
		int i;\
		for (i = 0; i < size; i++) {\
			lua_rawgeti(L,index,i+1);\
			if (lua_isnumber(L,-1)){\
				array[i] = (TYPE)lua_tonumber(L,-1);\
			} else {\
				lua_pop(L,1);\
				return 0;\
			}\
			lua_pop(L,1);\
		}\
		return 1;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
		TYPE *array;\
		if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
			SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
			SWIG_Lua_pusherrstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
	{\
		TYPE *array;\
		if (!lua_istable(L,index)) {\
			SWIG_Lua_pusherrstring(L,"expected a table");\
			return 0;\
		}\
		*size=SWIG_itable_size(L,index);\
		if (*size<1){\
			SWIG_Lua_pusherrstring(L,"table appears to be empty");\
			return 0;\
		}\
		array=SWIG_ALLOC_ARRAY(TYPE,*size);\
		if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
			SWIG_Lua_pusherrstring(L,"table must contain numbers");\
			SWIG_FREE_ARRAY(array);\
			return 0;\
		}\
		return array;\
	}\
	SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
		int i;\
		lua_newtable(L);\
		for (i = 0; i < size; i++){\
			lua_pushnumber(L,(lua_Number)array[i]);\
			lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \
		}\
	}

SWIG_DECLARE_TYPEMAP_ARR_FN(schar,signed char)
SWIG_DECLARE_TYPEMAP_ARR_FN(uchar,unsigned char)
SWIG_DECLARE_TYPEMAP_ARR_FN(int,int)
SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int)
SWIG_DECLARE_TYPEMAP_ARR_FN(short,short)
SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short)
SWIG_DECLARE_TYPEMAP_ARR_FN(long,long)
SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long)
SWIG_DECLARE_TYPEMAP_ARR_FN(float,float)
SWIG_DECLARE_TYPEMAP_ARR_FN(double,double)

SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
	int i;
	for (i = 0; i < size; i++) {
		lua_rawgeti(L,index,i+1);
		if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){
			lua_pop(L,1);
			return 0;
		}
		lua_pop(L,1);
	}
	return 1;
}
SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
		SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,size);
	if (!SWIG_read_ptr_array(L,index,array,size,type)){
		SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
	void **array;
	if (!lua_istable(L,index)) {
		SWIG_Lua_pusherrstring(L,"expected a table");
		return 0;
	}
	*size=SWIG_itable_size(L,index);
	if (*size<1){
		SWIG_Lua_pusherrstring(L,"table appears to be empty");
		return 0;
	}
	array=SWIG_ALLOC_ARRAY(void*,*size);
	if (!SWIG_read_ptr_array(L,index,array,*size,type)){
		SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
		SWIG_FREE_ARRAY(array);
		return 0;
	}
	return array;
}
SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
	int i;
	lua_newtable(L);
	for (i = 0; i < size; i++){
		SWIG_NewPointerObj(L,array[i],type,own);
		lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/
	}
}


#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 


#include <stdbool.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>

/* argh, swig undefs bool for perl */
#ifndef bool
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 202311L
typedef int bool;
#endif
#endif

#include "pool.h"
#include "poolarch.h"
#include "evr.h"
#include "solver.h"
#include "policy.h"
#include "solverdebug.h"
#include "repo_solv.h"
#include "chksum.h"
#include "selection.h"

#include "repo_write.h"
#if defined(ENABLE_RPMDB) || defined(ENABLE_RPMPKG)
#include "repo_rpmdb.h"
#endif
#ifdef ENABLE_PUBKEY
#include "repo_pubkey.h"
#endif
#ifdef ENABLE_DEBIAN
#include "repo_deb.h"
#endif
#ifdef ENABLE_RPMMD
#include "repo_rpmmd.h"
#include "repo_updateinfoxml.h"
#include "repo_deltainfoxml.h"
#include "repo_repomdxml.h"
#endif
#ifdef ENABLE_SUSEREPO
#include "repo_products.h"
#include "repo_susetags.h"
#include "repo_content.h"
#endif
#ifdef ENABLE_MDKREPO
#include "repo_mdk.h"
#endif
#ifdef ENABLE_ARCHREPO
#include "repo_arch.h"
#endif
#ifdef SUSE
#include "repo_autopattern.h"
#endif
#if defined(ENABLE_COMPLEX_DEPS) && (defined(ENABLE_SUSEREPO) || defined(ENABLE_RPMMD) || defined(ENABLE_RPMDB) || defined(ENABLE_RPMPKG))
#include "pool_parserpmrichdep.h"
#endif
#include "solv_xfopen.h"
#include "testcase.h"

/* for old ruby versions */
#ifndef RARRAY_PTR
#define RARRAY_PTR(ary) (RARRAY(ary)->ptr)
#endif
#ifndef RARRAY_LEN
#define RARRAY_LEN(ary) (RARRAY(ary)->len)
#endif

typedef void *AppObjectPtr;
typedef Id DepId;

typedef struct {
  Pool *pool;
  Id id;
} Dep;

typedef struct {
  Pool *pool;
  Id id;
} XSolvable;

typedef struct {
  Solver *solv;
  Id id;
} XRule;

typedef struct {
  Repo *repo;
  Id id;
} XRepodata;

typedef struct {
  Pool *pool;
  Id id;
} Pool_solvable_iterator;

typedef struct {
  Pool *pool;
  Id id;
} Pool_repo_iterator;

typedef struct {
  Repo *repo;
  Id id;
} Repo_solvable_iterator;

typedef struct {
  Pool *pool;
  int how;
  Id what;
} Job;

typedef struct {
  Solver *solv;
  Id id;
} Problem;

typedef struct {
  Solver *solv;
  Id problemid;
  Id id;
} Solution;

typedef struct {
  Solver *solv;
  Id problemid;
  Id solutionid;

  Id type;
  Id p;
  Id rp;
} Solutionelement;

typedef struct {
  Solver *solv;
  Id rid;
  int type;
  Id source;
  Id target;
  Id dep_id;
} Ruleinfo;

typedef struct {
  Solver *solv;
  Id type;
  Id rid;
  Id from_id;
  Id dep_id;
  Id chosen_id;
  Queue choices;
  int level;
} Alternative;

typedef struct {
  Transaction *transaction;
  int mode;
  Id type;
  int count;
  Id fromid;
  Id toid;
} TransactionClass;

typedef struct {
  Pool *pool;
  Queue q;
  int flags;
} Selection;

typedef struct {
  Solver *solv;
  Id p;
  int reason;
  Id infoid;
} Decision;

typedef struct {
  Solver *solv;
  Queue decisionlistq;
  Id p;
  int reason;
  Id infoid;
  int bits;
  int type;
  Id source;
  Id target;
  Id dep_id;
} Decisionset;

typedef struct {
  FILE *fp;
} SolvFp;

typedef Dataiterator Datamatch;

typedef int disown_helper;

struct myappdata {
  void *appdata;
  int disowned;
};

/* special internal decisionset constructor from a prepared decisionlist */
static Decisionset *decisionset_fromids(Solver *solv, Id *ids, int cnt)
{
  Decisionset *d = solv_calloc(1, sizeof(*d));
  int i;
  d->solv = solv;
  queue_init(&d->decisionlistq);
  d->p = ids[0];
  d->reason = ids[1];
  d->infoid = ids[2];
  d->bits = ids[3];
  d->type = ids[4];
  d->source = ids[5];
  d->target = ids[6];
  d->dep_id = ids[7];
  for (i = 0; i < cnt; i += 8)
    queue_insertn(&d->decisionlistq, d->decisionlistq.count, 3, ids + i);
  if (cnt > 8)
    d->infoid = 0;
  return d;
}

/* prepare a decisionlist so we can feed it to decisionset_fromids */
static void prepare_decisionset_queue(Solver *solv, Queue *q) {
  int i, cnt;
  for (i = cnt = 0; i < q->count; cnt++)
    {
      i += 1 + 8 + 8 * solver_decisionlist_merged(solv, q, i);  /* +1 as we insert one element */
      queue_insert(q, cnt, i - cnt);
    }
  if (cnt)
    queue_unshift(q, 1);        /* start of first block */
  for (i = 0; i < cnt; i++)
    q->elements[i] += cnt - i;
  q->count = cnt;   /* hack */
}



SWIGINTERN void appdata_disown_helper(void *appdata) {
}
SWIGINTERN void appdata_clr_helper(void **appdatap) {
  if (*appdatap) {
    void *appdata = *appdatap;
    clr_stashed_lua_var((lua_State*)appdata, "appdata", (void *)appdatap);
    *appdatap = 0;
  }
}
SWIGINTERN void appdata_set_helper(void **appdatap, void *appdata) {
  *appdatap = appdata;
  set_stashed_lua_var((lua_State*)appdata, -1, "appdata", (void *)appdatap);
}
SWIGINTERN void *appdata_get_helper(void **appdatap) {
  return (void *)appdatap;
}

SWIGINTERN Selection *new_Selection(Pool *pool){
    Selection *s;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    return s;
  }
SWIGINTERN void delete_Selection(Selection *self){
    queue_free(&self->q);
    solv_free(self);
  }
SWIGINTERN bool Selection_isempty(Selection *self){
    return self->q.count == 0;
  }
SWIGINTERN Selection *Selection_clone(Selection *self,int flags){
    Selection *s = new_Selection(self->pool);
    queue_init_clone(&s->q, &self->q);
    s->flags = self->flags;
    return s;
  }
SWIGINTERN void Selection_filter(Selection *self,Selection *lsel){
    if (self->pool != lsel->pool)
      queue_empty(&self->q);
    else
      selection_filter(self->pool, &self->q, &lsel->q);
  }
SWIGINTERN void Selection_add(Selection *self,Selection *lsel){
    if (self->pool == lsel->pool)
      {
        selection_add(self->pool, &self->q, &lsel->q);
        self->flags |= lsel->flags;
      }
  }
SWIGINTERN void Selection_add_raw(Selection *self,Id how,Id what){
    queue_push2(&self->q, how, what);
  }
SWIGINTERN void Selection_subtract(Selection *self,Selection *lsel){
    if (self->pool == lsel->pool)
      selection_subtract(self->pool, &self->q, &lsel->q);
  }

SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
  int ret = lua_isstring(L, idx);
  if (!ret)
   ret = lua_isnil(L, idx);
  return ret;
}

SWIGINTERN void Selection_select(Selection *self,char const *name,int flags){
    if ((flags & SELECTION_MODEBITS) == 0)
      flags |= SELECTION_FILTER | SELECTION_WITH_ALL;
    self->flags = selection_make(self->pool, &self->q, name, flags);
  }
SWIGINTERN void Selection_matchdeps(Selection *self,char const *name,int flags,Id keyname,Id marker){
    if ((flags & SELECTION_MODEBITS) == 0)
      flags |= SELECTION_FILTER | SELECTION_WITH_ALL;
    self->flags = selection_make_matchdeps(self->pool, &self->q, name, flags, keyname, marker);
  }


SWIGINTERN int





SWIG_AsValDepId(lua_State *L, int idx, int *val) {



  static swig_type_info* desc = 0;
  void *vptr = 0;
  int ecode;
  if (!desc) desc = SWIG_TypeQuery("Dep *");



  ecode = SWIG_AsVal_int(L, idx, val);



  if (SWIG_IsOK(ecode))
    return ecode;

  if ((SWIG_ConvertPtr(L, idx, &vptr, desc, 0)) == SWIG_OK) {



    if (val)
      *val = vptr ? ((Dep *)vptr)->id : 0;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}





SWIGINTERN void Selection_matchdepid(Selection *self,DepId dep,int flags,Id keyname,Id marker){
    if ((flags & SELECTION_MODEBITS) == 0)
      flags |= SELECTION_FILTER | SELECTION_WITH_ALL;
    self->flags = selection_make_matchdepid(self->pool, &self->q, dep, flags, keyname, marker);
  }
SWIGINTERN void Selection_matchsolvable(Selection *self,XSolvable *solvable,int flags,Id keyname,Id marker){
    if ((flags & SELECTION_MODEBITS) == 0)
      flags |= SELECTION_FILTER | SELECTION_WITH_ALL;
    self->flags = selection_make_matchsolvable(self->pool, &self->q, solvable->id, flags, keyname, marker);
  }
SWIGINTERN Queue Selection_jobs(Selection *self,int flags){
    Queue q;
    int i;
    queue_init_clone(&q, &self->q);
    for (i = 0; i < q.count; i += 2)
      q.elements[i] |= flags;
    return q;
  }
SWIGINTERN Queue Selection_solvables(Selection *self){
    Queue q;
    queue_init(&q);
    selection_solvables(self->pool, &self->q, &q);
    return q;
  }
SWIGINTERN char const *Selection___str__(Selection *self){
    return pool_selection2str(self->pool, &self->q, 0);
  }
SWIGINTERN char const *Selection___repr__(Selection *self){
    const char *str = pool_selection2str(self->pool, &self->q, ~0);
    return pool_tmpjoin(self->pool, "<Selection ", str, ">");
  }
SWIGINTERN Dep *new_Dep(Pool *pool,Id id){
    Dep *s;
    if (!id)
      return 0;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    s->id = id;
    return s;
  }
SWIGINTERN Dep *Dep_Rel(Dep *self,int flags,DepId evrid,bool create){
    Id id = pool_rel2id(self->pool, self->id, evrid, flags, create);
    if (!id)
      return 0;
    return new_Dep(self->pool, id);
  }
SWIGINTERN Selection *Dep_Selection_name(Dep *self,int setflags){
    Selection *sel = new_Selection(self->pool);
    if (ISRELDEP(self->id)) {
      Reldep *rd = GETRELDEP(self->pool, self->id);
      if (rd->flags == REL_EQ) {
        setflags |= self->pool->disttype == DISTTYPE_DEB || strchr(pool_id2str(self->pool, rd->evr), '-') != 0 ? SOLVER_SETEVR : SOLVER_SETEV;
        if (ISRELDEP(rd->name))
          rd = GETRELDEP(self->pool, rd->name);
      }
      if (rd->flags == REL_ARCH)
        setflags |= SOLVER_SETARCH;
    }
    queue_push2(&sel->q, SOLVER_SOLVABLE_NAME | setflags, self->id);
    return sel;
  }
SWIGINTERN Selection *Dep_Selection_provides(Dep *self,int setflags){
    Selection *sel = new_Selection(self->pool);
    if (ISRELDEP(self->id)) {
      Reldep *rd = GETRELDEP(self->pool, self->id);
      if (rd->flags == REL_ARCH)
        setflags |= SOLVER_SETARCH;
    }
    queue_push2(&sel->q, SOLVER_SOLVABLE_PROVIDES | setflags, self->id);
    return sel;
  }
SWIGINTERN char const *Dep_str(Dep *self){
    return pool_dep2str(self->pool, self->id);
  }
SWIGINTERN bool Dep___eq__(Dep *self,Dep *s){
    return self->pool == s->pool && self->id == s->id;
  }
SWIGINTERN bool Dep___ne__(Dep *self,Dep *s){
    return !Dep___eq__(self, s);
  }
SWIGINTERN char const *Dep___str__(Dep *self){
    return pool_dep2str(self->pool, self->id);
  }
SWIGINTERN char const *Dep___repr__(Dep *self){
    char buf[20];
    sprintf(buf, "<Id #%d ", self->id);
    return solv_dupjoin(buf, pool_dep2str(self->pool, self->id), ">");
  }
SWIGINTERN Dataiterator *new_Dataiterator(Pool *pool,Repo *repo,Id p,Id key,char const *match,int flags){
    Dataiterator *di = solv_calloc(1, sizeof(*di));
    dataiterator_init(di, pool, repo, p, key, match, flags);
    return di;
  }
SWIGINTERN void delete_Dataiterator(Dataiterator *self){
    dataiterator_free(self);
    solv_free(self);
  }
SWIGINTERN Datamatch *Dataiterator___next__(Dataiterator *self,void *ign1,void *ign2){



    Dataiterator *ndi;
    if (!dataiterator_step(self)) {
      return 0;
    }
    ndi = solv_calloc(1, sizeof(*ndi));
    dataiterator_init_clone(ndi, self);
    dataiterator_strdup(ndi);
    return ndi;
  }
SWIGINTERN void Dataiterator_prepend_keyname(Dataiterator *self,Id key){
    dataiterator_prepend_keyname(self, key);
  }
SWIGINTERN void Dataiterator_skip_solvable(Dataiterator *self){
    dataiterator_skip_solvable(self);
  }
SWIGINTERN XSolvable *new_XSolvable(Pool *pool,Id id){
    XSolvable *s;
    if (!id || id >= pool->nsolvables)
      return 0;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    s->id = id;
    return s;
  }
SWIGINTERN char const *XSolvable_str(XSolvable *self){
    return pool_solvid2str(self->pool, self->id);
  }
SWIGINTERN char const *XSolvable_lookup_str(XSolvable *self,Id keyname){
    return pool_lookup_str(self->pool, self->id, keyname);
  }
SWIGINTERN Id XSolvable_lookup_id(XSolvable *self,Id keyname){
    return pool_lookup_id(self->pool, self->id, keyname);
  }
SWIGINTERN unsigned long long XSolvable_lookup_num(XSolvable *self,Id keyname,unsigned long long notfound){
    return pool_lookup_num(self->pool, self->id, keyname, notfound);
  }
SWIGINTERN bool XSolvable_lookup_void(XSolvable *self,Id keyname){
    return pool_lookup_void(self->pool, self->id, keyname);
  }
SWIGINTERN Chksum *XSolvable_lookup_checksum(XSolvable *self,Id keyname){
    Id type = 0;
    const unsigned char *b = pool_lookup_bin_checksum(self->pool, self->id, keyname, &type);
    return solv_chksum_create_from_bin(type, b);
  }
SWIGINTERN Queue XSolvable_lookup_idarray(XSolvable *self,Id keyname,Id marker){
    Solvable *s = self->pool->solvables + self->id;
    Queue r;
    queue_init(&r);
    solvable_lookup_deparray(s, keyname, &r, marker);
    return r;
  }
SWIGINTERN Queue XSolvable_lookup_deparray(XSolvable *self,Id keyname,Id marker){
    Solvable *s = self->pool->solvables + self->id;
    Queue r;
    queue_init(&r);
    solvable_lookup_deparray(s, keyname, &r, marker);
    return r;
  }
SWIGINTERN char const *XSolvable_lookup_location(XSolvable *self,unsigned int *OUTPUT){
    return solvable_lookup_location(self->pool->solvables + self->id, OUTPUT);
  }
SWIGINTERN char const *XSolvable_lookup_sourcepkg(XSolvable *self){
    return solvable_lookup_sourcepkg(self->pool->solvables + self->id);
  }
SWIGINTERN Dataiterator *XSolvable_Dataiterator(XSolvable *self,Id key,char const *match,int flags){
    return new_Dataiterator(self->pool, 0, self->id, key, match, flags);
  }
SWIGINTERN bool XSolvable_installable(XSolvable *self){
    return pool_installable(self->pool, pool_id2solvable(self->pool, self->id));
  }
SWIGINTERN bool XSolvable_isinstalled(XSolvable *self){
    Pool *pool = self->pool;
    return pool->installed && pool_id2solvable(pool, self->id)->repo == pool->installed;
  }

    SWIGINTERN void XSolvable_name_set(XSolvable *xs, const char *name) {
      Pool *pool = xs->pool;
      pool->solvables[xs->id].name = pool_str2id(pool, name, 1);
    }
    SWIGINTERN const char *XSolvable_name_get(XSolvable *xs) {
      Pool *pool = xs->pool;
      return pool_id2str(pool, pool->solvables[xs->id].name);
    }
  

    SWIGINTERN void XSolvable_nameid_set(XSolvable *xs, Id nameid) {
      xs->pool->solvables[xs->id].name = nameid;
    }
    SWIGINTERN Id XSolvable_nameid_get(XSolvable *xs) {
      return xs->pool->solvables[xs->id].name;
    }
  

    SWIGINTERN void XSolvable_evr_set(XSolvable *xs, const char *evr) {
      Pool *pool = xs->pool;
      pool->solvables[xs->id].evr = pool_str2id(pool, evr, 1);
    }
    SWIGINTERN const char *XSolvable_evr_get(XSolvable *xs) {
      Pool *pool = xs->pool;
      return pool_id2str(pool, pool->solvables[xs->id].evr);
    }
  

    SWIGINTERN void XSolvable_evrid_set(XSolvable *xs, Id evrid) {
      xs->pool->solvables[xs->id].evr = evrid;
    }
    SWIGINTERN Id XSolvable_evrid_get(XSolvable *xs) {
      return xs->pool->solvables[xs->id].evr;
    }
  

    SWIGINTERN void XSolvable_arch_set(XSolvable *xs, const char *arch) {
      Pool *pool = xs->pool;
      pool->solvables[xs->id].arch = pool_str2id(pool, arch, 1);
    }
    SWIGINTERN const char *XSolvable_arch_get(XSolvable *xs) {
      Pool *pool = xs->pool;
      return pool_id2str(pool, pool->solvables[xs->id].arch);
    }
  

    SWIGINTERN void XSolvable_archid_set(XSolvable *xs, Id archid) {
      xs->pool->solvables[xs->id].arch = archid;
    }
    SWIGINTERN Id XSolvable_archid_get(XSolvable *xs) {
      return xs->pool->solvables[xs->id].arch;
    }
  

    SWIGINTERN void XSolvable_vendor_set(XSolvable *xs, const char *vendor) {
      Pool *pool = xs->pool;
      pool->solvables[xs->id].vendor = pool_str2id(pool, vendor, 1);
    }
    SWIGINTERN const char *XSolvable_vendor_get(XSolvable *xs) {
      Pool *pool = xs->pool;
      return pool_id2str(pool, pool->solvables[xs->id].vendor);
    }
  

    SWIGINTERN void XSolvable_vendorid_set(XSolvable *xs, Id vendorid) {
      xs->pool->solvables[xs->id].vendor = vendorid;
    }
    SWIGINTERN Id XSolvable_vendorid_get(XSolvable *xs) {
      return xs->pool->solvables[xs->id].vendor;
    }
  

    SWIGINTERN Repo *XSolvable_repo_get(XSolvable *xs) {
      return xs->pool->solvables[xs->id].repo;
    }
  
SWIGINTERN void XSolvable_add_provides(XSolvable *self,DepId id,Id marker){
    Solvable *s = self->pool->solvables + self->id;
    marker = solv_depmarker(SOLVABLE_PROVIDES, marker);
    s->provides = repo_addid_dep(s->repo, s->provides, id, marker);
  }
SWIGINTERN void XSolvable_add_obsoletes(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->obsoletes = repo_addid_dep(s->repo, s->obsoletes, id, 0);
  }
SWIGINTERN void XSolvable_add_conflicts(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->conflicts = repo_addid_dep(s->repo, s->conflicts, id, 0);
  }
SWIGINTERN void XSolvable_add_requires(XSolvable *self,DepId id,Id marker){
    Solvable *s = self->pool->solvables + self->id;
    marker = solv_depmarker(SOLVABLE_REQUIRES, marker);
    s->requires = repo_addid_dep(s->repo, s->requires, id, marker);
  }
SWIGINTERN void XSolvable_add_recommends(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->recommends = repo_addid_dep(s->repo, s->recommends, id, 0);
  }
SWIGINTERN void XSolvable_add_suggests(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->suggests = repo_addid_dep(s->repo, s->suggests, id, 0);
  }
SWIGINTERN void XSolvable_add_supplements(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->supplements = repo_addid_dep(s->repo, s->supplements, id, 0);
  }
SWIGINTERN void XSolvable_add_enhances(XSolvable *self,DepId id){
    Solvable *s = self->pool->solvables + self->id;
    s->enhances = repo_addid_dep(s->repo, s->enhances, id, 0);
  }
SWIGINTERN void XSolvable_unset(XSolvable *self,Id keyname){
    Solvable *s = self->pool->solvables + self->id;
    repo_unset(s->repo, self->id, keyname);
  }
SWIGINTERN void XSolvable_add_deparray(XSolvable *self,Id keyname,DepId id,Id marker){
    Solvable *s = self->pool->solvables + self->id;
    solvable_add_deparray(s, keyname, id, marker);
  }
SWIGINTERN Selection *XSolvable_Selection(XSolvable *self,int setflags){
    Selection *sel = new_Selection(self->pool);
    queue_push2(&sel->q, SOLVER_SOLVABLE | setflags, self->id);
    return sel;
  }
SWIGINTERN bool XSolvable_identical(XSolvable *self,XSolvable *s2){
    return solvable_identical(self->pool->solvables + self->id, s2->pool->solvables + s2->id);
  }
SWIGINTERN int XSolvable_evrcmp(XSolvable *self,XSolvable *s2){
    return pool_evrcmp(self->pool, self->pool->solvables[self->id].evr, s2->pool->solvables[s2->id].evr, EVRCMP_COMPARE);
  }
SWIGINTERN bool XSolvable_matchesdep(XSolvable *self,Id keyname,DepId id,Id marker){
    return solvable_matchesdep(self->pool->solvables + self->id, keyname, id, marker);
  }
SWIGINTERN bool XSolvable___eq__(XSolvable *self,XSolvable *s){
    return self->pool == s->pool && self->id == s->id;
  }
SWIGINTERN bool XSolvable___ne__(XSolvable *self,XSolvable *s){
    return !XSolvable___eq__(self, s);
  }
SWIGINTERN char const *XSolvable___str__(XSolvable *self){
    return pool_solvid2str(self->pool, self->id);
  }
SWIGINTERN char const *XSolvable___repr__(XSolvable *self){
    char buf[20];
    sprintf(buf, "<Solvable #%d ", self->id);
    return solv_dupjoin(buf, pool_solvid2str(self->pool, self->id), ">");
  }
SWIGINTERN Ruleinfo *new_Ruleinfo(Solver *solv,Id rid,Id type,Id source,Id target,Id dep_id){
    Ruleinfo *ri = solv_calloc(1, sizeof(*ri));
    ri->solv = solv;
    ri->rid = rid;
    ri->type = type;
    ri->source = source;
    ri->target = target;
    ri->dep_id = dep_id;
    return ri;
  }

    SWIGINTERN XSolvable *Ruleinfo_solvable_get(Ruleinfo *ri) {
      return new_XSolvable(ri->solv->pool, ri->source);
    }
    SWIGINTERN XSolvable *Ruleinfo_othersolvable_get(Ruleinfo *ri) {
      return new_XSolvable(ri->solv->pool, ri->target);
    }
    SWIGINTERN Dep *Ruleinfo_dep_get(Ruleinfo *ri) {
      return new_Dep(ri->solv->pool, ri->dep_id);
    }
  
SWIGINTERN char const *Ruleinfo_problemstr(Ruleinfo *self){
    return solver_problemruleinfo2str(self->solv, self->type, self->source, self->target, self->dep_id);
  }
SWIGINTERN char const *Ruleinfo___str__(Ruleinfo *self){
    return solver_ruleinfo2str(self->solv, self->type, self->source, self->target, self->dep_id);
  }
SWIGINTERN XRule *new_XRule(Solver *solv,Id id){
    if (!id)
      return 0;
    XRule *xr = solv_calloc(1, sizeof(*xr));
    xr->solv = solv;
    xr->id = id;
    return xr;
  }

    SWIGINTERN int XRule_type_get(XRule *xr) {
      return solver_ruleclass(xr->solv, xr->id);
    }
  
SWIGINTERN Ruleinfo *XRule_info(XRule *self){
    Id type, source, target, dep;
    type = solver_ruleinfo(self->solv, self->id, &source, &target, &dep);
    return new_Ruleinfo(self->solv, self->id, type, source, target, dep);
  }
SWIGINTERN Queue XRule_allinfos(XRule *self){
    Queue q;
    queue_init(&q);
    solver_allruleinfos(self->solv, self->id, &q);
    return q;
  }
SWIGINTERN Queue XRule_get_learnt(XRule *self){
    Queue q;
    queue_init(&q);
    solver_get_learnt(self->solv, self->id, SOLVER_DECISIONLIST_LEARNTRULE, &q);
    return q;
  }
SWIGINTERN Queue XRule_get_decisionlist(XRule *self){
    Queue q;
    queue_init(&q);
    solver_get_decisionlist(self->solv, self->id, SOLVER_DECISIONLIST_LEARNTRULE | SOLVER_DECISIONLIST_SORTED, &q);
    return q;
  }
SWIGINTERN Queue XRule_get_decisionsetlist(XRule *self){
    Queue q;
    queue_init(&q);
    solver_get_decisionlist(self->solv, self->id, SOLVER_DECISIONLIST_LEARNTRULE | SOLVER_DECISIONLIST_SORTED | SOLVER_DECISIONLIST_WITHINFO | SOLVER_DECISIONLIST_MERGEDINFO, &q);
    prepare_decisionset_queue(self->solv, &q);
    return q;
  }
SWIGINTERN bool XRule___eq__(XRule *self,XRule *xr){
    return self->solv == xr->solv && self->id == xr->id;
  }
SWIGINTERN bool XRule___ne__(XRule *self,XRule *xr){
    return !XRule___eq__(self, xr);
  }
SWIGINTERN char const *XRule___repr__(XRule *self){
    char buf[20];
    sprintf(buf, "<Rule #%d>", self->id);
    return solv_strdup(buf);
  }
SWIGINTERN XRepodata *new_XRepodata(Repo *repo,Id id){
    XRepodata *xr = solv_calloc(1, sizeof(*xr));
    xr->repo = repo;
    xr->id = id;
    return xr;
  }
SWIGINTERN Id XRepodata_new_handle(XRepodata *self){
    return repodata_new_handle(repo_id2repodata(self->repo, self->id));
  }
SWIGINTERN void XRepodata_set_id(XRepodata *self,Id solvid,Id keyname,DepId id){
    repodata_set_id(repo_id2repodata(self->repo, self->id), solvid, keyname, id);
  }
SWIGINTERN void XRepodata_set_num(XRepodata *self,Id solvid,Id keyname,unsigned long long num){
    repodata_set_num(repo_id2repodata(self->repo, self->id), solvid, keyname, num);
  }
SWIGINTERN void XRepodata_set_str(XRepodata *self,Id solvid,Id keyname,char const *str){
    repodata_set_str(repo_id2repodata(self->repo, self->id), solvid, keyname, str);
  }
SWIGINTERN void XRepodata_set_void(XRepodata *self,Id solvid,Id keyname){
    repodata_set_void(repo_id2repodata(self->repo, self->id), solvid, keyname);
  }
SWIGINTERN void XRepodata_set_poolstr(XRepodata *self,Id solvid,Id keyname,char const *str){
    repodata_set_poolstr(repo_id2repodata(self->repo, self->id), solvid, keyname, str);
  }
SWIGINTERN void XRepodata_add_idarray(XRepodata *self,Id solvid,Id keyname,DepId id){
    repodata_add_idarray(repo_id2repodata(self->repo, self->id), solvid, keyname, id);
  }
SWIGINTERN void XRepodata_add_flexarray(XRepodata *self,Id solvid,Id keyname,Id handle){
    repodata_add_flexarray(repo_id2repodata(self->repo, self->id), solvid, keyname, handle);
  }
SWIGINTERN void XRepodata_set_checksum(XRepodata *self,Id solvid,Id keyname,Chksum *chksum){
    const unsigned char *buf = solv_chksum_get(chksum, 0);
    if (buf)
      repodata_set_bin_checksum(repo_id2repodata(self->repo, self->id), solvid, keyname, solv_chksum_get_type(chksum), buf);
  }
SWIGINTERN void XRepodata_set_sourcepkg(XRepodata *self,Id solvid,char const *sourcepkg){
    repodata_set_sourcepkg(repo_id2repodata(self->repo, self->id), solvid, sourcepkg);
  }
SWIGINTERN void XRepodata_set_location(XRepodata *self,Id solvid,unsigned int mediano,char const *location){
    repodata_set_location(repo_id2repodata(self->repo, self->id), solvid, mediano, 0, location);
  }
SWIGINTERN void XRepodata_unset(XRepodata *self,Id solvid,Id keyname){
    repodata_unset(repo_id2repodata(self->repo, self->id), solvid, keyname);
  }
SWIGINTERN char const *XRepodata_lookup_str(XRepodata *self,Id solvid,Id keyname){
    return repodata_lookup_str(repo_id2repodata(self->repo, self->id), solvid, keyname);
  }
SWIGINTERN Id XRepodata_lookup_id(XRepodata *self,Id solvid,Id keyname){
    return repodata_lookup_id(repo_id2repodata(self->repo, self->id), solvid, keyname);
  }
SWIGINTERN unsigned long long XRepodata_lookup_num(XRepodata *self,Id solvid,Id keyname,unsigned long long notfound){
    return repodata_lookup_num(repo_id2repodata(self->repo, self->id), solvid, keyname, notfound);
  }
SWIGINTERN bool XRepodata_lookup_void(XRepodata *self,Id solvid,Id keyname){
    return repodata_lookup_void(repo_id2repodata(self->repo, self->id), solvid, keyname);
  }
SWIGINTERN Queue XRepodata_lookup_idarray(XRepodata *self,Id solvid,Id keyname){
    Queue r;
    queue_init(&r);
    repodata_lookup_idarray(repo_id2repodata(self->repo, self->id), solvid, keyname, &r);
    return r;
  }
SWIGINTERN Chksum *XRepodata_lookup_checksum(XRepodata *self,Id solvid,Id keyname){
    Id type = 0;
    const unsigned char *b = repodata_lookup_bin_checksum(repo_id2repodata(self->repo, self->id), solvid, keyname, &type);
    return solv_chksum_create_from_bin(type, b);
  }
SWIGINTERN void XRepodata_internalize(XRepodata *self){
    repodata_internalize(repo_id2repodata(self->repo, self->id));
  }
SWIGINTERN void XRepodata_create_stubs(XRepodata *self){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    data = repodata_create_stubs(data);
    self->id = data->repodataid;
  }



SWIGINTERN int





SWIG_AsValSolvFpPtr(lua_State *L, int idx, FILE **val) {



  static swig_type_info* desc = 0;
  void *vptr = 0;




  if (!desc) desc = SWIG_TypeQuery("SolvFp *");

  if ((SWIG_ConvertPtr(L, idx, &vptr, desc, 0)) == SWIG_OK) {



    if (val)
      *val = vptr ? ((SolvFp *)vptr)->fp : 0;
    return SWIG_OK;
  }





  return SWIG_TypeError;
}






SWIGINTERN bool XRepodata_write(XRepodata *self,FILE *fp){
    return repodata_write(repo_id2repodata(self->repo, self->id), fp) == 0;
  }
SWIGINTERN Id XRepodata_str2dir(XRepodata *self,char const *dir,bool create){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    return repodata_str2dir(data, dir, create);
  }
SWIGINTERN char const *XRepodata_dir2str(XRepodata *self,Id did,char const *suf){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    return repodata_dir2str(data, did, suf);
  }
SWIGINTERN void XRepodata_add_dirstr(XRepodata *self,Id solvid,Id keyname,Id dir,char const *str){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    repodata_add_dirstr(data, solvid, keyname, dir, str);
  }
SWIGINTERN bool XRepodata_add_solv(XRepodata *self,FILE *fp,int flags){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    int r, oldstate = data->state;
    data->state = REPODATA_LOADING;
    r = repo_add_solv(data->repo, fp, flags | REPO_USE_LOADING);
    if (r || data->state == REPODATA_LOADING)
      data->state = oldstate;
    return r == 0;
  }
SWIGINTERN void XRepodata_extend_to_repo(XRepodata *self){
    Repodata *data = repo_id2repodata(self->repo, self->id);
    repodata_extend_block(data, data->repo->start, data->repo->end - data->repo->start);
  }
SWIGINTERN bool XRepodata___eq__(XRepodata *self,XRepodata *xr){
    return self->repo == xr->repo && self->id == xr->id;
  }
SWIGINTERN bool XRepodata___ne__(XRepodata *self,XRepodata *xr){
    return !XRepodata___eq__(self, xr);
  }
SWIGINTERN char const *XRepodata___repr__(XRepodata *self){
    char buf[20];
    sprintf(buf, "<Repodata #%d>", self->id);
    return solv_strdup(buf);
  }
SWIGINTERN Pool_solvable_iterator *new_Pool_solvable_iterator(Pool *pool){
    Pool_solvable_iterator *s;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    return s;
  }
SWIGINTERN XSolvable *Pool_solvable_iterator___next__(Pool_solvable_iterator *self,void *ign1,void *ign2){



    Pool *pool = self->pool;
    if (self->id >= pool->nsolvables)
      return 0;
    while (++self->id < pool->nsolvables)
      if (pool->solvables[self->id].repo)
        return new_XSolvable(pool, self->id);
    return 0;
  }
SWIGINTERN XSolvable *Pool_solvable_iterator___getitem__(Pool_solvable_iterator *self,Id key){
    Pool *pool = self->pool;
    if (key > 0 && key < pool->nsolvables && pool->solvables[key].repo)
      return new_XSolvable(pool, key);
    return 0;
  }
SWIGINTERN int Pool_solvable_iterator___len__(Pool_solvable_iterator *self){
    return self->pool->nsolvables;
  }
SWIGINTERN Pool_repo_iterator *new_Pool_repo_iterator(Pool *pool){
    Pool_repo_iterator *s;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    return s;
  }
SWIGINTERN Repo *Pool_repo_iterator___next__(Pool_repo_iterator *self,void *ign1,void *ign2){



    Pool *pool = self->pool;
    if (self->id >= pool->nrepos)
      return 0;
    while (++self->id < pool->nrepos) {
      Repo *r = pool_id2repo(pool, self->id);
      if (r)
        return r;
    }
    return 0;
  }
SWIGINTERN Repo *Pool_repo_iterator___getitem__(Pool_repo_iterator *self,Id key){
    Pool *pool = self->pool;
    if (key > 0 && key < pool->nrepos)
      return pool_id2repo(pool, key);
    return 0;
  }
SWIGINTERN int Pool_repo_iterator___len__(Pool_repo_iterator *self){
    return self->pool->nrepos;
  }
SWIGINTERN Repo_solvable_iterator *new_Repo_solvable_iterator(Repo *repo){
    Repo_solvable_iterator *s;
    s = solv_calloc(1, sizeof(*s));
    s->repo = repo;
    return s;
  }
SWIGINTERN XSolvable *Repo_solvable_iterator___next__(Repo_solvable_iterator *self,void *ign1,void *ign2){



    Repo *repo = self->repo;
    Pool *pool = repo->pool;
    if (repo->start > 0 && self->id < repo->start)
      self->id = repo->start - 1;
    if (self->id >= repo->end)
      return 0;
    while (++self->id < repo->end)
      if (pool->solvables[self->id].repo == repo)
        return new_XSolvable(pool, self->id);
    return 0;
  }
SWIGINTERN XSolvable *Repo_solvable_iterator___getitem__(Repo_solvable_iterator *self,Id key){
    Repo *repo = self->repo;
    Pool *pool = repo->pool;
    if (key > 0 && key < pool->nsolvables && pool->solvables[key].repo == repo)
      return new_XSolvable(pool, key);
    return 0;
  }
SWIGINTERN int Repo_solvable_iterator___len__(Repo_solvable_iterator *self){
    return self->repo->pool->nsolvables;
  }
SWIGINTERN void delete_Datamatch(Datamatch *self){
    dataiterator_free(self);
    solv_free(self);
  }

  SWIGINTERN XSolvable *Datamatch_solvable_get(Dataiterator *di) {
    return new_XSolvable(di->pool, di->solvid);
  }
  SWIGINTERN Id Datamatch_key_id_get(Dataiterator *di) {
    return di->key->name;
  }
  SWIGINTERN const char *Datamatch_key_idstr_get(Dataiterator *di) {
    return pool_id2str(di->pool, di->key->name);
  }
  SWIGINTERN Id Datamatch_type_id_get(Dataiterator *di) {
    return di->key->type;
  }
  SWIGINTERN const char *Datamatch_type_idstr_get(Dataiterator *di) {
    return pool_id2str(di->pool, di->key->type);
  }
  SWIGINTERN Id Datamatch_id_get(Dataiterator *di) {
    return di->kv.id;
  }
  SWIGINTERN const char *Datamatch_idstr_get(Dataiterator *di) {
   if (di->data && (di->key->type == REPOKEY_TYPE_DIR || di->key->type == REPOKEY_TYPE_DIRSTRARRAY || di->key->type == REPOKEY_TYPE_DIRNUMNUMARRAY))
      return repodata_dir2str(di->data,  di->kv.id, 0);
    if (di->data && di->data->localpool)
      return stringpool_id2str(&di->data->spool, di->kv.id);
    return pool_id2str(di->pool, di->kv.id);
  }
  SWIGINTERN const char * const Datamatch_str_get(Dataiterator *di) {
    return di->kv.str;
  }
  SWIGINTERN Dep *Datamatch_dep_get(Dataiterator *di) {
    if (di->key->type == REPOKEY_TYPE_DIR || di->key->type == REPOKEY_TYPE_DIRSTRARRAY || di->key->type == REPOKEY_TYPE_DIRNUMNUMARRAY)
      return 0;
    if (di->data && di->data->localpool)
      return 0;
    return new_Dep(di->pool, di->kv.id);
  }
  SWIGINTERN BinaryBlob Datamatch_binary_get(Dataiterator *di) {
    BinaryBlob bl;
    bl.data = 0;
    bl.len = 0;
    if (di->key->type == REPOKEY_TYPE_BINARY)
      {
        bl.data = di->kv.str;
        bl.len = di->kv.num;
      }
    else if ((bl.len = solv_chksum_len(di->key->type)) != 0)
      bl.data = di->kv.str;
    return bl;
  }
  SWIGINTERN unsigned long long Datamatch_num_get(Dataiterator *di) {
   if (di->key->type == REPOKEY_TYPE_NUM)
     return SOLV_KV_NUM64(&di->kv);
   return di->kv.num;
  }
  SWIGINTERN unsigned int Datamatch_num2_get(Dataiterator *di) {
    return di->kv.num2;
  }
  
SWIGINTERN Datapos *Datamatch_pos(Datamatch *self){
    Pool *pool = self->pool;
    Datapos *pos, oldpos = pool->pos;
    dataiterator_setpos(self);
    pos = solv_calloc(1, sizeof(*pos));
    *pos = pool->pos;
    pool->pos = oldpos;
    return pos;
  }
SWIGINTERN Datapos *Datamatch_parentpos(Datamatch *self){
    Pool *pool = self->pool;
    Datapos *pos, oldpos = pool->pos;
    dataiterator_setpos_parent(self);
    pos = solv_calloc(1, sizeof(*pos));
    *pos = pool->pos;
    pool->pos = oldpos;
    return pos;
  }
SWIGINTERN char const *Datamatch___str__(Datamatch *self){
    KeyValue kv = self->kv;
    const char *str = repodata_stringify(self->pool, self->data, self->key, &kv, SEARCH_FILES | SEARCH_CHECKSUMS);
    return str ? str : "";
  }
SWIGINTERN Id Datapos_lookup_id(Datapos *self,Id keyname){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    Id r;
    pool->pos = *self;
    r = pool_lookup_id(pool, SOLVID_POS, keyname);
    pool->pos = oldpos;
    return r;
  }
SWIGINTERN char const *Datapos_lookup_str(Datapos *self,Id keyname){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    const char *r;
    pool->pos = *self;
    r = pool_lookup_str(pool, SOLVID_POS, keyname);
    pool->pos = oldpos;
    return r;
  }
SWIGINTERN unsigned long long Datapos_lookup_num(Datapos *self,Id keyname,unsigned long long notfound){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    unsigned long long r;
    pool->pos = *self;
    r = pool_lookup_num(pool, SOLVID_POS, keyname, notfound);
    pool->pos = oldpos;
    return r;
  }
SWIGINTERN bool Datapos_lookup_void(Datapos *self,Id keyname){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    int r;
    pool->pos = *self;
    r = pool_lookup_void(pool, SOLVID_POS, keyname);
    pool->pos = oldpos;
    return r;
  }
SWIGINTERN Chksum *Datapos_lookup_checksum(Datapos *self,Id keyname){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    Id type = 0;
    const unsigned char *b;
    pool->pos = *self;
    b = pool_lookup_bin_checksum(pool, SOLVID_POS, keyname, &type);
    pool->pos = oldpos;
    return solv_chksum_create_from_bin(type, b);
  }
SWIGINTERN char const *Datapos_lookup_deltaseq(Datapos *self){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    const char *seq;
    pool->pos = *self;
    seq = pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_NAME);
    if (seq) {
      seq = pool_tmpjoin(pool, seq, "-", pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_EVR));
      seq = pool_tmpappend(pool, seq, "-", pool_lookup_str(pool, SOLVID_POS, DELTA_SEQ_NUM));
    }
    pool->pos = oldpos;
    return seq;
  }
SWIGINTERN char const *Datapos_lookup_deltalocation(Datapos *self,unsigned int *OUTPUT){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    const char *loc;
    pool->pos = *self;
    loc = pool_lookup_deltalocation(pool, SOLVID_POS, OUTPUT);
    pool->pos = oldpos;
    return loc;
  }
SWIGINTERN Queue Datapos_lookup_idarray(Datapos *self,Id keyname){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    Queue r;
    queue_init(&r);
    pool->pos = *self;
    pool_lookup_idarray(pool, SOLVID_POS, keyname, &r);
    pool->pos = oldpos;
    return r;
  }
SWIGINTERN Dataiterator *Datapos_Dataiterator(Datapos *self,Id key,char const *match,int flags){
    Pool *pool = self->repo->pool;
    Datapos oldpos = pool->pos;
    Dataiterator *di;
    pool->pos = *self;
    di = new_Dataiterator(pool, 0, SOLVID_POS, key, match, flags);
    pool->pos = oldpos;
    return di;
  }
SWIGINTERN Job *new_Job(Pool *pool,int how,Id what){
    Job *job = solv_calloc(1, sizeof(*job));
    job->pool = pool;
    job->how = how;
    job->what = what;
    return job;
  }
SWIGINTERN Queue Job_solvables(Job *self){
    Queue q;
    queue_init(&q);
    pool_job2solvables(self->pool, &q, self->how, self->what);
    return q;
  }
SWIGINTERN bool Job_isemptyupdate(Job *self){
    return pool_isemptyupdatejob(self->pool, self->how, self->what);
  }
SWIGINTERN bool Job___eq__(Job *self,Job *j){
    return self->pool == j->pool && self->how == j->how && self->what == j->what;
  }
SWIGINTERN bool Job___ne__(Job *self,Job *j){
    return !Job___eq__(self, j);
  }
SWIGINTERN char const *Job___str__(Job *self){
    return pool_job2str(self->pool, self->how, self->what, 0);
  }
SWIGINTERN char const *Job___repr__(Job *self){
    const char *str = pool_job2str(self->pool, self->how, self->what, ~0);
    return pool_tmpjoin(self->pool, "<Job ", str, ">");
  }
SWIGINTERN Pool *new_Pool(void){
    Pool *pool = pool_create();
    return pool;
  }
SWIGINTERN int Pool_setdisttype(Pool *self,int disttype){
    return pool_setdisttype(self, disttype);
  }
SWIGINTERN void Pool_set_debuglevel(Pool *self,int level){
    pool_setdebuglevel(self, level);
  }
SWIGINTERN int Pool_set_flag(Pool *self,int flag,int value){
    return pool_set_flag(self, flag, value);
  }
SWIGINTERN int Pool_get_flag(Pool *self,int flag){
    return pool_get_flag(self, flag);
  }
SWIGINTERN void Pool_set_rootdir(Pool *self,char const *rootdir){
    pool_set_rootdir(self, rootdir);
  }
SWIGINTERN char const *Pool_get_rootdir(Pool *self,int flag){
    return pool_get_rootdir(self);
  }

  SWIGINTERN int loadcallback(Pool *pool, Repodata *data, void *d) {
    lua_State* L = d;
    get_stashed_lua_var(L, "loadcallback", pool);
    XRepodata *xd = new_XRepodata(data->repo, data->repodataid);
    SWIG_NewPointerObj(L,SWIG_as_voidptr(xd), SWIGTYPE_p_XRepodata, 0);
    int res = lua_pcall(L, 1, 1, 0);
    res = res == LUA_OK ? lua_toboolean(L, -1) : 0;
    lua_pop(L, 1);
    return res;
  }
  
SWIGINTERN void Pool_clr_loadcallback(Pool *self){
    if (self->loadcallback == loadcallback) {
      lua_State* L = self->loadcallbackdata;
      clr_stashed_lua_var(L, "loadcallback", self);
      pool_setloadcallback(self, 0, 0);
    }
  }
SWIGINTERN void Pool_set_loadcallback(Pool *self,int lua_function_idx,lua_State *L){
    clr_stashed_lua_var(L, "loadcallback", self);
    if (!lua_isnil(L, lua_function_idx))  {
      set_stashed_lua_var(L, lua_function_idx, "loadcallback", self);
      pool_setloadcallback(self, loadcallback, L);
    }
  }
SWIGINTERN void delete_Pool(Pool *self){
    Pool *pool = self;
    Id repoid;
    Repo *repo;
    FOR_REPOS(repoid, repo)
      appdata_clr_helper(&repo->appdata);
    Pool_clr_loadcallback(pool);
    appdata_clr_helper(&pool->appdata);
    pool_free(pool);
  }
SWIGINTERN disown_helper Pool_free(Pool *self){
    Pool *pool = self;
    Id repoid;
    Repo *repo;
    FOR_REPOS(repoid, repo)
      appdata_clr_helper(&repo->appdata);
    Pool_clr_loadcallback(pool);
    appdata_clr_helper(&pool->appdata);
    pool_free(pool);
    return 0;
  }
SWIGINTERN disown_helper Pool_disown(Pool *self){
    return 0;
  }

  SWIGINTERN void Pool_appdata_set(Pool *pool, AppObjectPtr appdata) {
    appdata_set_helper(&pool->appdata, appdata);
  }
  SWIGINTERN AppObjectPtr Pool_appdata_get(Pool *pool) {
    return appdata_get_helper(&pool->appdata);
  }
  
SWIGINTERN void Pool_appdata_disown(Pool *self){
    appdata_disown_helper(self->appdata);
  }
SWIGINTERN Id Pool_str2id(Pool *self,char const *str,bool create){
    return pool_str2id(self, str, create);
  }
SWIGINTERN Dep *Pool_Dep(Pool *self,char const *str,bool create){
    Id id = pool_str2id(self, str, create);
    return new_Dep(self, id);
  }
SWIGINTERN char const *Pool_id2str(Pool *self,Id id){
    return pool_id2str(self, id);
  }
SWIGINTERN char const *Pool_dep2str(Pool *self,Id id){
    return pool_dep2str(self, id);
  }
SWIGINTERN Id Pool_rel2id(Pool *self,Id name,Id evr,int flags,bool create){
    return pool_rel2id(self, name, evr, flags, create);
  }
SWIGINTERN Id Pool_id2langid(Pool *self,Id id,char const *lang,bool create){
    return pool_id2langid(self, id, lang, create);
  }
SWIGINTERN void Pool_setarch(Pool *self,char const *arch){
    struct utsname un;
    if (!arch) {
      if (uname(&un)) {
        perror("uname");
        return;
      }
      arch = un.machine;
    }
    pool_setarch(self, arch);
  }
SWIGINTERN Repo *Pool_add_repo(Pool *self,char const *name){
    return repo_create(self, name);
  }
SWIGINTERN char const *Pool_lookup_str(Pool *self,Id entry,Id keyname){
    return pool_lookup_str(self, entry, keyname);
  }
SWIGINTERN Id Pool_lookup_id(Pool *self,Id entry,Id keyname){
    return pool_lookup_id(self, entry, keyname);
  }
SWIGINTERN unsigned long long Pool_lookup_num(Pool *self,Id entry,Id keyname,unsigned long long notfound){
    return pool_lookup_num(self, entry, keyname, notfound);
  }
SWIGINTERN bool Pool_lookup_void(Pool *self,Id entry,Id keyname){
    return pool_lookup_void(self, entry, keyname);
  }
SWIGINTERN Chksum *Pool_lookup_checksum(Pool *self,Id entry,Id keyname){
    Id type = 0;
    const unsigned char *b = pool_lookup_bin_checksum(self, entry, keyname, &type);
    return solv_chksum_create_from_bin(type, b);
  }
SWIGINTERN Dataiterator *Pool_Dataiterator(Pool *self,Id key,char const *match,int flags){
    return new_Dataiterator(self, 0, 0, key, match, flags);
  }
SWIGINTERN Dataiterator *Pool_Dataiterator_solvid(Pool *self,Id p,Id key,char const *match,int flags){
    return new_Dataiterator(self, 0, p, key, match, flags);
  }
SWIGINTERN char const *Pool_solvid2str(Pool *self,Id solvid){
    return pool_solvid2str(self, solvid);
  }
SWIGINTERN char const *Pool_solvidset2str(Pool *self,Queue q){
    return pool_solvidset2str(self, &q);
  }
SWIGINTERN char const *Pool_solvableset2str(Pool *self,Queue solvables){
    return pool_solvidset2str(self, &solvables);
  }
SWIGINTERN void Pool_addfileprovides(Pool *self){
    pool_addfileprovides(self);
  }
SWIGINTERN Queue Pool_addfileprovides_queue(Pool *self){
    Queue r;
    queue_init(&r);
    pool_addfileprovides_queue(self, &r, 0);
    return r;
  }
SWIGINTERN void Pool_createwhatprovides(Pool *self){
    pool_createwhatprovides(self);
  }
SWIGINTERN XSolvable *Pool_id2solvable(Pool *self,Id id){
    return new_XSolvable(self, id);
  }

  SWIGINTERN Pool_solvable_iterator * Pool_solvables_get(Pool *pool) {
    return new_Pool_solvable_iterator(pool);
  }
  
SWIGINTERN Pool_solvable_iterator *Pool_solvables_iter(Pool *self){
    return new_Pool_solvable_iterator(self);
  }
SWIGINTERN Repo *Pool_id2repo(Pool *self,Id id){
    if (id < 1 || id >= self->nrepos)
      return 0;
    return pool_id2repo(self, id);
  }

  SWIGINTERN Pool_repo_iterator * Pool_repos_get(Pool *pool) {
    return new_Pool_repo_iterator(pool);
  }
  
SWIGINTERN Pool_repo_iterator *Pool_repos_iter(Pool *self){
    return new_Pool_repo_iterator(self);
  }

  SWIGINTERN void Pool_installed_set(Pool *pool, Repo *installed) {
    pool_set_installed(pool, installed);
  }
  SWIGINTERN Repo *Pool_installed_get(Pool *pool) {
    return pool->installed;
  }
  SWIGINTERN const char *Pool_errstr_get(Pool *pool) {
    return pool_errstr(pool);
  }
  
SWIGINTERN Queue Pool_matchprovidingids(Pool *self,char const *match,int flags){
    Pool *pool = self;
    Queue q;
    Id id;
    queue_init(&q);
    if (!flags) {
      for (id = 1; id < pool->ss.nstrings; id++)
        if (pool->whatprovides[id])
          queue_push(&q, id);
    } else {
      Datamatcher ma;
      if (!datamatcher_init(&ma, match, flags)) {
        for (id = 1; id < pool->ss.nstrings; id++)
          if (pool->whatprovides[id] && datamatcher_match(&ma, pool_id2str(pool, id)))
            queue_push(&q, id);
        datamatcher_free(&ma);
      }
    }
    return q;
  }
SWIGINTERN Job *Pool_Job(Pool *self,int how,Id what){
    return new_Job(self, how, what);
  }
SWIGINTERN Queue Pool_whatprovides(Pool *self,DepId dep){
    Pool *pool = self;
    Queue q;
    Id p, pp;
    queue_init(&q);
    FOR_PROVIDES(p, pp, dep)
      queue_push(&q, p);
    return q;
  }
SWIGINTERN Queue Pool_best_solvables(Pool *self,Queue solvables,int flags){
    Queue q;
    queue_init_clone(&q, &solvables);
    pool_best_solvables(self, &q, flags);
    return q;
  }
SWIGINTERN Id Pool_towhatprovides(Pool *self,Queue q){
    return pool_queuetowhatprovides(self, &q);
  }
SWIGINTERN void Pool_set_namespaceproviders(Pool *self,DepId ns,DepId evr,bool value){
    Id dep = pool_rel2id(self, ns, evr, REL_NAMESPACE, 1);
    pool_set_whatprovides(self, dep, value ? 2 : 1);
  }
SWIGINTERN void Pool_flush_namespaceproviders(Pool *self,DepId ns,DepId evr){
    pool_flush_namespaceproviders(self, ns, evr);
  }
SWIGINTERN Queue Pool_whatcontainsdep(Pool *self,Id keyname,DepId dep,Id marker){
    Queue q;
    queue_init(&q);
    pool_whatcontainsdep(self, keyname, dep, &q, marker);
    return q;
  }
SWIGINTERN Queue Pool_whatmatchesdep(Pool *self,Id keyname,DepId dep,Id marker){
    Queue q;
    queue_init(&q);
    pool_whatmatchesdep(self, keyname, dep, &q, marker);
    return q;
  }
SWIGINTERN Queue Pool_whatmatchessolvable(Pool *self,Id keyname,XSolvable *pool_solvable,Id marker){
    Queue q;
    queue_init(&q);
    pool_whatmatchessolvable(self, keyname, pool_solvable->id, &q, marker);
    return q;
  }
SWIGINTERN bool Pool_isknownarch(Pool *self,DepId id){
    Pool *pool = self;
    if (!id || id == ID_EMPTY)
      return 0;
    if (id == ARCH_SRC || id == ARCH_NOSRC || id == ARCH_NOARCH)
      return 1;
    if (pool->id2arch && pool_arch2score(pool, id) == 0)
      return 0;
    return 1;
  }
SWIGINTERN Solver *Pool_Solver(Pool *self){
    return solver_create(self);
  }
SWIGINTERN Selection *Pool_Selection(Pool *self){
    return new_Selection(self);
  }
SWIGINTERN Selection *Pool_Selection_all(Pool *self,int setflags){
    Selection *sel = new_Selection(self);
    queue_push2(&sel->q, SOLVER_SOLVABLE_ALL | setflags, 0);
    return sel;
  }
SWIGINTERN Selection *Pool_select(Pool *self,char const *name,int flags){
    Selection *sel = new_Selection(self);
    sel->flags = selection_make(self, &sel->q, name, flags);
    return sel;
  }
SWIGINTERN Selection *Pool_matchdeps(Pool *self,char const *name,int flags,Id keyname,Id marker){
    Selection *sel = new_Selection(self);
    sel->flags = selection_make_matchdeps(self, &sel->q, name, flags, keyname, marker);
    return sel;
  }
SWIGINTERN Selection *Pool_matchdepid(Pool *self,DepId dep,int flags,Id keyname,Id marker){
    Selection *sel = new_Selection(self);
    sel->flags = selection_make_matchdepid(self, &sel->q, dep, flags, keyname, marker);
    return sel;
  }
SWIGINTERN Selection *Pool_matchsolvable(Pool *self,XSolvable *solvable,int flags,Id keyname,Id marker){
    Selection *sel = new_Selection(self);
    sel->flags = selection_make_matchsolvable(self, &sel->q, solvable->id, flags, keyname, marker);
    return sel;
  }
SWIGINTERN Queue Pool_get_considered_list(Pool *self){
    Queue q;
    queue_init(&q);
    int i;
    for (i = 2; i < self->nsolvables; i++) {
      if (self->solvables[i].repo && (!self->considered || MAPTST(self->considered, i)))
        queue_push(&q, i);
    }
    return q;
  }
SWIGINTERN Queue Pool_get_disabled_list(Pool *self){
    Queue q;
    queue_init(&q);
    int i;
    for (i = 2; i < self->nsolvables; i++) {
      if (self->solvables[i].repo && (self->considered && !MAPTST(self->considered, i)))
        queue_push(&q, i);
    }
    return q;
  }
SWIGINTERN void Pool_set_considered_list(Pool *self,Queue q){
    int i;
    Id p;
    if (!self->considered) {
      self->considered = solv_calloc(1, sizeof(Map));
      map_init(self->considered, self->nsolvables);
    }
    map_empty(self->considered);
    MAPSET(self->considered, 1);
    for (i = 0; i < q.count; i++) {
      p = q.elements[i];
      if (p > 0 && p < self->nsolvables)
        MAPSET(self->considered, p);
    }
  }
SWIGINTERN void Pool_set_disabled_list(Pool *self,Queue q){
    int i;
    Id p;
    if (!q.count) {
      if (self->considered) {
        map_free(self->considered);
        self->considered = solv_free(self->considered);
      }
      return;
    }
    if (!self->considered) {
      self->considered = solv_calloc(1, sizeof(Map));
      map_init(self->considered, self->nsolvables);
    }
    map_setall(self->considered);
    for (i = 0; i < q.count; i++) {
      p = q.elements[i];
      if (p > 0 && p < self->nsolvables)
        MAPCLR(self->considered, p);
    }
  }
SWIGINTERN void Pool_setpooljobs(Pool *self,Queue solvejobs){
    queue_free(&self->pooljobs);
    queue_init_clone(&self->pooljobs, &solvejobs);
  }
SWIGINTERN Queue Pool_getpooljobs(Pool *self){
    Queue q;
    queue_init_clone(&q, &self->pooljobs);
    return q;
  }
SWIGINTERN void Repo_free(Repo *self,bool reuseids){
    appdata_clr_helper(&self->appdata);
    repo_free(self, reuseids);
  }
SWIGINTERN void Repo_empty(Repo *self,bool reuseids){
    repo_empty(self, reuseids);
  }
SWIGINTERN bool Repo_isempty(Repo *self){
    return !self->nsolvables;
  }

  SWIGINTERN void Repo_appdata_set(Repo *repo, AppObjectPtr appdata) {
    appdata_set_helper(&repo->appdata, appdata);
  }
  SWIGINTERN AppObjectPtr Repo_appdata_get(Repo *repo) {
    return appdata_get_helper(&repo->appdata);
  }
  
SWIGINTERN bool Repo_add_solv__SWIG_0(Repo *self,char const *name,int flags){
    FILE *fp = fopen(name, "r");
    int r;
    if (!fp)
      return 0;
    r = repo_add_solv(self, fp, flags);
    fclose(fp);
    return r == 0;
  }
SWIGINTERN bool Repo_add_solv__SWIG_1(Repo *self,FILE *fp,int flags){
    return repo_add_solv(self, fp, flags) == 0;
  }
SWIGINTERN XSolvable *Repo_add_solvable(Repo *self){
    Id solvid = repo_add_solvable(self);
    return new_XSolvable(self->pool, solvid);
  }
SWIGINTERN void Repo_internalize(Repo *self){
    repo_internalize(self);
  }
SWIGINTERN bool Repo_write(Repo *self,FILE *fp){
    return repo_write(self, fp) == 0;
  }
SWIGINTERN bool Repo_write_first_repodata(Repo *self,FILE *fp){
    int oldnrepodata = self->nrepodata;
    int res;
    self->nrepodata = oldnrepodata > 2 ? 2 : oldnrepodata;
    res = repo_write(self, fp);
    self->nrepodata = oldnrepodata;
    return res == 0;
  }
SWIGINTERN Dataiterator *Repo_Dataiterator(Repo *self,Id key,char const *match,int flags){
    return new_Dataiterator(self->pool, self, 0, key, match, flags);
  }
SWIGINTERN Dataiterator *Repo_Dataiterator_meta(Repo *self,Id key,char const *match,int flags){
    return new_Dataiterator(self->pool, self, SOLVID_META, key, match, flags);
  }

  SWIGINTERN Id Repo_id_get(Repo *repo) {
    return repo->repoid;
  }
  

  SWIGINTERN Repo_solvable_iterator * Repo_solvables_get(Repo *repo) {
    return new_Repo_solvable_iterator(repo);
  }
  

  SWIGINTERN Datapos * Repo_meta_get(Repo *repo) {
    Datapos *pos = solv_calloc(1, sizeof(*pos));
    pos->solvid = SOLVID_META;
    pos->repo = repo;
    return pos;
  }
  
SWIGINTERN Repo_solvable_iterator *Repo_solvables_iter(Repo *self){
    return new_Repo_solvable_iterator(self);
  }
SWIGINTERN XRepodata *Repo_add_repodata(Repo *self,int flags){
    Repodata *rd = repo_add_repodata(self, flags);
    return new_XRepodata(self, rd->repodataid);
  }
SWIGINTERN void Repo_create_stubs(Repo *self){
    Repodata *data;
    if (!self->nrepodata)
      return;
    data = repo_id2repodata(self, self->nrepodata - 1);
    if (data->state != REPODATA_STUB)
      (void)repodata_create_stubs(data);
  }
SWIGINTERN bool Repo_iscontiguous(Repo *self){
    int i;
    for (i = self->start; i < self->end; i++)
      if (self->pool->solvables[i].repo != self)
        return 0;
    return 1;
  }
SWIGINTERN XRepodata *Repo_first_repodata(Repo *self){
    Repodata *data;
    int i;
    if (self->nrepodata < 2)
      return 0;
    /* make sure all repodatas but the first are extensions */
    data = repo_id2repodata(self, 1);
    if (data->loadcallback)
       return 0;
    for (i = 2; i < self->nrepodata; i++)
      {
        data = repo_id2repodata(self, i);
        if (!data->loadcallback)
          return 0;       /* oops, not an extension */
      }
    return new_XRepodata(self, 1);
  }
SWIGINTERN Selection *Repo_Selection(Repo *self,int setflags){
    Selection *sel = new_Selection(self->pool);
    setflags |= SOLVER_SETREPO;
    queue_push2(&sel->q, SOLVER_SOLVABLE_REPO | setflags, self->repoid);
    return sel;
  }
SWIGINTERN Repo *Repo_createshadow(Repo *self,char const *name){
    Repo *repo = repo_create(self->pool, name);
    if (self->idarraysize) {
      repo_reserve_ids(repo, 0, self->idarraysize);
      memcpy(repo->idarraydata, self->idarraydata, sizeof(Id) * self->idarraysize);
      repo->idarraysize = self->idarraysize;
    }
    repo->start = self->start;
    repo->end = self->end;
    repo->nsolvables = self->nsolvables;
    return repo;
  }
SWIGINTERN void Repo_moveshadow(Repo *self,Queue q){
    Pool *pool = self->pool;
    int i;
    for (i = 0; i < q.count; i++) {
      Solvable *s;
      Id p = q.elements[i];
      if (p < self->start || p >= self->end)
        continue;
      s = pool->solvables + p;
      if (self->idarraysize != s->repo->idarraysize)
        continue;
      s->repo = self;
    }
  }
SWIGINTERN bool Repo___eq__(Repo *self,Repo *repo){
    return self == repo;
  }
SWIGINTERN bool Repo___ne__(Repo *self,Repo *repo){
    return self != repo;
  }
SWIGINTERN char const *Repo___str__(Repo *self){
    char buf[20];
    if (self->name)
      return solv_strdup(self->name);
    sprintf(buf, "Repo#%d", self->repoid);
    return solv_strdup(buf);
  }
SWIGINTERN char const *Repo___repr__(Repo *self){
    char buf[20];
    if (self->name)
      {
        sprintf(buf, "<Repo #%d ", self->repoid);
        return solv_dupjoin(buf, self->name, ">");
      }
    sprintf(buf, "<Repo #%d>", self->repoid);
    return solv_strdup(buf);
  }
SWIGINTERN Decision *new_Decision(Solver *solv,Id p,int reason,Id infoid){
    Decision *d = solv_calloc(1, sizeof(*d));
    d->solv = solv;
    d->p = p;
    d->reason = reason;
    d->infoid = infoid;
    return d;
  }

    SWIGINTERN XRule *Decision_rule_get(Decision *d) {
      return d->reason == SOLVER_REASON_WEAKDEP || d->infoid <= 0 ? 0 : new_XRule(d->solv, d->infoid);
    }
    SWIGINTERN XSolvable *Decision_solvable_get(Decision *d) {
      return new_XSolvable(d->solv->pool, d->p >= 0 ? d->p : -d->p);
    }
  
SWIGINTERN Ruleinfo *Decision_info(Decision *self){
    Id type, source, target, dep;
    if (self->reason == SOLVER_REASON_WEAKDEP) {
      type = solver_weakdepinfo(self->solv, self->p, &source, &target, &dep);
    } else if (self->infoid) {
      type = solver_ruleinfo(self->solv, self->infoid, &source, &target, &dep);
    } else {
      return 0;
    }
    return new_Ruleinfo(self->solv, self->infoid, type, source, target, dep);
  }
SWIGINTERN Queue Decision_allinfos(Decision *self){
    Queue q;
    queue_init(&q);
    if (self->reason == SOLVER_REASON_WEAKDEP) {
      solver_allweakdepinfos(self->solv, self->p, &q);
    } else if (self->infoid) {
      solver_allruleinfos(self->solv, self->infoid, &q);
    }
    return q;
  }
SWIGINTERN char const *Decision_reasonstr(Decision *self,bool noinfo){
    if (noinfo)
      return solver_reason2str(self->solv, self->reason);
    return solver_decisionreason2str(self->solv, self->p, self->reason, self->infoid);
  }
SWIGINTERN char const *Decision___str__(Decision *self){
    Pool *pool = self->solv->pool;
    if (self->p == 0 && self->reason == SOLVER_REASON_UNSOLVABLE)
      return "unsolvable";
    if (self->p >= 0)
      return pool_tmpjoin(pool, "install ", pool_solvid2str(pool, self->p), 0);
    else
      return pool_tmpjoin(pool, "conflict ", pool_solvid2str(pool, -self->p), 0);
  }
SWIGINTERN Decisionset *new_Decisionset(Solver *solv){
    Decisionset *d = solv_calloc(1, sizeof(*d));
    d->solv = solv;
    queue_init(&d->decisionlistq);
    return d;
  }
SWIGINTERN void delete_Decisionset(Decisionset *self){
    queue_free(&self->decisionlistq);
    solv_free(self);
  }
SWIGINTERN Ruleinfo *Decisionset_info(Decisionset *self){
    return new_Ruleinfo(self->solv, self->infoid, self->type, self->source, self->target, self->dep_id);
  }

    SWIGINTERN Dep *Decisionset_dep_get(Decisionset *d) {
      return new_Dep(d->solv->pool, d->dep_id);
    }
  
SWIGINTERN Queue Decisionset_solvables(Decisionset *self){
    Queue q;
    int i;
    queue_init(&q);
    for (i = 0; i < self->decisionlistq.count; i += 3)
      if (self->decisionlistq.elements[i] != 0)
        queue_push(&q, self->decisionlistq.elements[i] > 0 ? self->decisionlistq.elements[i] : -self->decisionlistq.elements[i]);
    return q;
  }
SWIGINTERN Queue Decisionset_decisions(Decisionset *self){
    Queue q;
    queue_init_clone(&q, &self->decisionlistq);
    return q;
  }
SWIGINTERN char const *Decisionset_reasonstr(Decisionset *self,bool noinfo){
    if (noinfo || !self->type)
      return solver_reason2str(self->solv, self->reason);
    return solver_decisioninfo2str(self->solv, self->bits, self->type, self->source, self->target, self->dep_id);
  }
SWIGINTERN char const *Decisionset___str__(Decisionset *self){
    Pool *pool = self->solv->pool;
    Queue q;
    int i;
    const char *s;
    if (!self->decisionlistq.elements)
      return "";
    if (self->p == 0 && self->reason == SOLVER_REASON_UNSOLVABLE)
      return "unsolvable";
    queue_init(&q);
    for (i = 0; i < self->decisionlistq.count; i += 3)
      if (self->decisionlistq.elements[i] != 0)
        queue_push(&q, self->decisionlistq.elements[i] > 0 ? self->decisionlistq.elements[i] : -self->decisionlistq.elements[i]);
    s = pool_solvidset2str(pool, &q);
    queue_free(&q);
    return pool_tmpjoin(pool, self->p >= 0 ? "install " : "conflict ", s, 0);
  }
SWIGINTERN void delete_Solver(Solver *self){
    solver_free(self);
  }
SWIGINTERN int Solver_set_flag(Solver *self,int flag,int value){
    return solver_set_flag(self, flag, value);
  }
SWIGINTERN int Solver_get_flag(Solver *self,int flag){
    return solver_get_flag(self, flag);
  }
SWIGINTERN Queue Solver_solve(Solver *self,Queue solvejobs){
    Queue q;
    int i, cnt;
    queue_init(&q);
    solver_solve(self, &solvejobs);
    cnt = solver_problem_count(self);
    for (i = 1; i <= cnt; i++)
      queue_push(&q, i);
    return q;
  }
SWIGINTERN Transaction *Solver_transaction(Solver *self){
    return solver_create_transaction(self);
  }
SWIGINTERN int Solver_describe_decision(Solver *self,XSolvable *s,XRule **OUTPUT){
    Id ruleid;
    int reason = solver_describe_decision(self, s->id, &ruleid);
    *OUTPUT = new_XRule(self, ruleid);
    return reason;
  }
SWIGINTERN Queue Solver_describe_weakdep_decision_raw(Solver *self,XSolvable *s){
    Queue q;
    queue_init(&q);
    solver_describe_weakdep_decision(self, s->id, &q);
    return q;
  }
SWIGINTERN int Solver_alternatives_count(Solver *self){
    return solver_alternatives_count(self);
  }
SWIGINTERN Alternative *Solver_get_alternative(Solver *self,Id aid){
    Alternative *a = solv_calloc(1, sizeof(*a));
    a->solv = self;
    queue_init(&a->choices);
    a->type = solver_get_alternative(self, aid, &a->dep_id, &a->from_id, &a->chosen_id, &a->choices, &a->level);
    if (!a->type) {
      queue_free(&a->choices);
      solv_free(a);
      return 0;
    }
    if (a->type == SOLVER_ALTERNATIVE_TYPE_RULE) {
      a->rid = a->dep_id;
      a->dep_id = 0;
    }
    return a;
  }
SWIGINTERN Queue Solver_alternatives(Solver *self){
    Queue q;
    int i, cnt;
    queue_init(&q);
    cnt = solver_alternatives_count(self);
    for (i = 1; i <= cnt; i++)
      queue_push(&q, i);
    return q;
  }
SWIGINTERN bool Solver_write_testcase(Solver *self,char const *dir){
    return testcase_write(self, dir, TESTCASE_RESULT_TRANSACTION | TESTCASE_RESULT_PROBLEMS, 0, 0);
  }
SWIGINTERN Queue Solver_raw_decisions(Solver *self,int filter){
    Queue q;
    queue_init(&q);
    solver_get_decisionqueue(self, &q);
    if (filter) {
      int i, j;
      for (i = j = 0; i < q.count; i++)
        if ((filter > 0 && q.elements[i] > 1) ||
            (filter < 0 && q.elements[i] < 0))
          q.elements[j++] = q.elements[i];
      queue_truncate(&q, j);
    }
    return q;
  }
SWIGINTERN Queue Solver_all_decisions(Solver *self,int filter){
    int i, j, cnt;
    Queue q;
    queue_init(&q);
    solver_get_decisionqueue(self, &q);
    if (filter) {
      for (i = j = 0; i < q.count; i++)
        if ((filter > 0 && q.elements[i] > 1) ||
            (filter < 0 && q.elements[i] < 0))
          q.elements[j++] = q.elements[i];
      queue_truncate(&q, j);
    }
    cnt = q.count;
    for (i = 0; i < cnt; i++) {
      Id ruleid, p = q.elements[i];
      int reason;
      if (p == 0 || p == 1)
        continue;       /* ignore system solvable */
      reason = solver_describe_decision(self, p > 0 ? p : -p, &ruleid);
      queue_push(&q, p);
      queue_push2(&q, reason, ruleid);
    }
    queue_deleten(&q, 0, cnt);
    return q;
  }
SWIGINTERN Decision *Solver_get_decision(Solver *self,XSolvable *s){
    Id info;
    int lvl = solver_get_decisionlevel(self, s->id);
    Id p = lvl > 0 ? s->id : -s->id;
    int reason = solver_describe_decision(self, p, &info);
    return new_Decision(self, p, reason, info);
  }
SWIGINTERN Queue Solver_get_learnt(Solver *self,XSolvable *s){
    Queue q;
    queue_init(&q);
    solver_get_learnt(self, s->id, SOLVER_DECISIONLIST_SOLVABLE, &q);
    return q;
  }
SWIGINTERN Queue Solver_get_decisionlist(Solver *self,XSolvable *s){
    Queue q;
    queue_init(&q);
    solver_get_decisionlist(self, s->id, SOLVER_DECISIONLIST_SOLVABLE, &q);
    return q;
  }
SWIGINTERN Queue Solver_get_recommended(Solver *self,bool noselected){
    Queue q;
    queue_init(&q);
    solver_get_recommendations(self, &q, NULL, noselected);
    return q;
  }
SWIGINTERN Queue Solver_get_suggested(Solver *self,bool noselected){
    Queue q;
    queue_init(&q);
    solver_get_recommendations(self, NULL, &q, noselected);
    return q;
  }
SWIGINTERN Chksum *new_Chksum__SWIG_0(Id type){
    return solv_chksum_create(type);
  }
SWIGINTERN Chksum *new_Chksum__SWIG_1(Id type,char const *hex){
    unsigned char buf[64];
    int l = solv_chksum_len(type);
    if (!l)
      return 0;
    if (solv_hex2bin(&hex, buf, sizeof(buf)) != l || hex[0])
      return 0;
    return solv_chksum_create_from_bin(type, buf);
  }
SWIGINTERN Chksum *Chksum_from_bin(Id type,unsigned char const *str,size_t len){
    return len == solv_chksum_len(type) ? solv_chksum_create_from_bin(type, str) : 0;
  }
SWIGINTERN void delete_Chksum(Chksum *self){
    solv_chksum_free(self, 0);
  }

  SWIGINTERN Id Chksum_type_get(Chksum *chk) {
    return solv_chksum_get_type(chk);
  }
  
SWIGINTERN void Chksum_add(Chksum *self,unsigned char const *str,size_t len){
    solv_chksum_add(self, str, (int)len);
  }
SWIGINTERN void Chksum_add_fp(Chksum *self,FILE *fp){
    char buf[4096];
    int l;
    while ((l = fread(buf, 1, sizeof(buf), fp)) > 0)
      solv_chksum_add(self, buf, l);
    rewind(fp);         /* convenience */
  }
SWIGINTERN void Chksum_add_fd(Chksum *self,int fd){
    char buf[4096];
    int l;
    while ((l = read(fd, buf, sizeof(buf))) > 0)
      solv_chksum_add(self, buf, l);
    lseek(fd, 0, 0);    /* convenience */
  }
SWIGINTERN void Chksum_add_stat(Chksum *self,char const *filename){
    struct stat stb;
    if (stat(filename, &stb))
      memset(&stb, 0, sizeof(stb));
    solv_chksum_add(self, &stb.st_dev, sizeof(stb.st_dev));
    solv_chksum_add(self, &stb.st_ino, sizeof(stb.st_ino));
    solv_chksum_add(self, &stb.st_size, sizeof(stb.st_size));
    solv_chksum_add(self, &stb.st_mtime, sizeof(stb.st_mtime));
  }
SWIGINTERN void Chksum_add_fstat(Chksum *self,int fd){
    struct stat stb;
    if (fstat(fd, &stb))
      memset(&stb, 0, sizeof(stb));
    solv_chksum_add(self, &stb.st_dev, sizeof(stb.st_dev));
    solv_chksum_add(self, &stb.st_ino, sizeof(stb.st_ino));
    solv_chksum_add(self, &stb.st_size, sizeof(stb.st_size));
    solv_chksum_add(self, &stb.st_mtime, sizeof(stb.st_mtime));
  }
SWIGINTERN BinaryBlob Chksum_raw(Chksum *self){
    BinaryBlob bl;
    int l;
    const unsigned char *b;
    b = solv_chksum_get(self, &l);
    bl.data = b;
    bl.len = l;
    return bl;
  }
SWIGINTERN char *Chksum_hex(Chksum *self){
    int l;
    const unsigned char *b;
    char *ret;

    b = solv_chksum_get(self, &l);
    ret = solv_malloc(2 * l + 1);
    solv_bin2hex(b, l, ret);
    return ret;
  }
SWIGINTERN char const *Chksum_typestr(Chksum *self){
    return solv_chksum_type2str(solv_chksum_get_type(self));
  }
SWIGINTERN bool Chksum___eq__(Chksum *self,Chksum *chk){
    return solv_chksum_cmp(self, chk);
  }
SWIGINTERN bool Chksum___ne__(Chksum *self,Chksum *chk){
    return !solv_chksum_cmp(self, chk);
  }
SWIGINTERN char const *Chksum___str__(Chksum *self){
    const char *str;
    const char *h = 0;
    if (solv_chksum_isfinished(self))
      h = Chksum_hex(self);
    str = solv_dupjoin(solv_chksum_type2str(solv_chksum_get_type(self)), ":", h ? h : "unfinished");
    solv_free((void *)h);
    return str;
  }
SWIGINTERN char const *Chksum___repr__(Chksum *self){
    const char *h = Chksum___str__(self);
    const char *str = solv_dupjoin("<Chksum ", h, ">");
    solv_free((void *)h);
    return str;
  }
SWIGINTERN void delete_SolvFp(SolvFp *self){
    if (self->fp)
      fclose(self->fp);
    free(self);
  }
SWIGINTERN int SolvFp_fileno(SolvFp *self){
    return self->fp ? fileno(self->fp) : -1;
  }
SWIGINTERN int SolvFp_dup(SolvFp *self){
    return self->fp ? dup(fileno(self->fp)) : -1;
  }
SWIGINTERN bool SolvFp_write(SolvFp *self,unsigned char const *str,size_t len){
    return fwrite(str, len, 1, self->fp) == 1;
  }
SWIGINTERN bool SolvFp_flush(SolvFp *self){
    if (!self->fp)
      return 1;
    return fflush(self->fp) == 0;
  }
SWIGINTERN bool SolvFp_close(SolvFp *self){
    bool ret;
    if (!self->fp)
      return 1;
    ret = fclose(self->fp) == 0;
    self->fp = 0;
    return ret;
  }
SWIGINTERN void SolvFp_cloexec(SolvFp *self,bool state){
    if (!self->fp || fileno(self->fp) == -1)
      return;
    solv_setcloexec(fileno(self->fp), state);
  }

  SWIGINTERN SolvFp *solvfp_xfopen_fd(const char *fn, int fd, const char *mode) {
    SolvFp *sfp;
    FILE *fp;
    fd = dup(fd);
    if (fd == -1)
      return 0;
    solv_setcloexec(fd, 1);
    fp = solv_xfopen_fd(fn, fd, mode);
    if (!fp) {
      close(fd);
      return 0;
    }
    sfp = solv_calloc(1, sizeof(SolvFp));
    sfp->fp = fp;
    return sfp;
  }
  SWIGINTERN SolvFp *solvfp_xfopen(const char *fn, const char *mode) {
    SolvFp *sfp;
    FILE *fp;
    fp = solv_xfopen(fn, mode);
    if (!fp)
      return 0;
    if (fileno(fp) != -1)
      solv_setcloexec(fileno(fp), 1);
    sfp = solv_calloc(1, sizeof(SolvFp));
    sfp->fp = fp;
    return sfp;
  }

SWIGINTERN Problem *new_Problem(Solver *solv,Id id){
    Problem *p;
    p = solv_calloc(1, sizeof(*p));
    p->solv = solv;
    p->id = id;
    return p;
  }
SWIGINTERN XRule *Problem_findproblemrule(Problem *self){
    Id r = solver_findproblemrule(self->solv, self->id);
    return new_XRule(self->solv, r);
  }
SWIGINTERN Queue Problem_findallproblemrules(Problem *self,int unfiltered){
    Solver *solv = self->solv;
    Id probr;
    int i, j;
    Queue q;
    queue_init(&q);
    solver_findallproblemrules(solv, self->id, &q);
    if (!unfiltered)
      {
        for (i = j = 0; i < q.count; i++)
          {
            SolverRuleinfo rclass;
            probr = q.elements[i];
            rclass = solver_ruleclass(solv, probr);
            if (rclass == SOLVER_RULE_UPDATE || rclass == SOLVER_RULE_JOB)
              continue;
            q.elements[j++] = probr;
          }
        if (j)
          queue_truncate(&q, j);
      }
    return q;
  }
SWIGINTERN int Problem_solution_count(Problem *self){
    return solver_solution_count(self->solv, self->id);
  }
SWIGINTERN Queue Problem_solutions(Problem *self){
    Queue q;
    int i, cnt;
    queue_init(&q);
    cnt = solver_solution_count(self->solv, self->id);
    for (i = 1; i <= cnt; i++)
      queue_push(&q, i);
    return q;
  }
SWIGINTERN Queue Problem_get_learnt(Problem *self){
    Queue q;
    queue_init(&q);
    solver_get_learnt(self->solv, self->id, SOLVER_DECISIONLIST_PROBLEM, &q);
    return q;
  }
SWIGINTERN Queue Problem_get_decisionlist(Problem *self){
    Queue q;
    queue_init(&q);
    solver_get_decisionlist(self->solv, self->id, SOLVER_DECISIONLIST_PROBLEM | SOLVER_DECISIONLIST_SORTED, &q);
    return q;
  }
SWIGINTERN Queue Problem_get_decisionsetlist(Problem *self){
    Queue q;
    queue_init(&q);
    solver_get_decisionlist(self->solv, self->id, SOLVER_DECISIONLIST_PROBLEM | SOLVER_DECISIONLIST_SORTED | SOLVER_DECISIONLIST_WITHINFO | SOLVER_DECISIONLIST_MERGEDINFO, &q);
    prepare_decisionset_queue(self->solv, &q);
    return q;
  }
SWIGINTERN char const *Problem___str__(Problem *self){
    return solver_problem2str(self->solv, self->id);
  }
SWIGINTERN Solution *new_Solution(Problem *p,Id id){
    Solution *s;
    s = solv_calloc(1, sizeof(*s));
    s->solv = p->solv;
    s->problemid = p->id;
    s->id = id;
    return s;
  }
SWIGINTERN int Solution_element_count(Solution *self){
    return solver_solutionelement_count(self->solv, self->problemid, self->id);
  }
SWIGINTERN Queue Solution_elements(Solution *self,bool expandreplaces){
    Queue q;
    queue_init(&q);
    solver_all_solutionelements(self->solv, self->problemid, self->id, expandreplaces, &q);
    return q;
  }
SWIGINTERN Solutionelement *new_Solutionelement(Solver *solv,Id problemid,Id solutionid,Id type,Id p,Id rp){
    Solutionelement *e;
    e = solv_calloc(1, sizeof(*e));
    e->solv = solv;
    e->problemid = problemid;
    e->solutionid = solutionid;
    e->type = type;
    e->p = p;
    e->rp = rp;
    return e;
  }
SWIGINTERN char const *Solutionelement_str(Solutionelement *self){
    return solver_solutionelementtype2str(self->solv, self->type, self->p, self->rp);
  }
SWIGINTERN char const *Solutionelement___str__(Solutionelement *self){
    return solver_solutionelementtype2str(self->solv, self->type, self->p, self->rp);
  }
SWIGINTERN Queue Solutionelement_replaceelements(Solutionelement *self){
    Queue q;
    int illegal;

    queue_init(&q);
    if (self->type != SOLVER_SOLUTION_REPLACE || self->p <= 0 || self->rp <= 0)
      illegal = 0;
    else
      illegal = policy_is_illegal(self->solv, self->solv->pool->solvables + self->p, self->solv->pool->solvables + self->rp, 0);
    if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
      queue_push(&q, SOLVER_SOLUTION_REPLACE_DOWNGRADE);
    if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
      queue_push(&q, SOLVER_SOLUTION_REPLACE_ARCHCHANGE);
    if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
      queue_push(&q, SOLVER_SOLUTION_REPLACE_VENDORCHANGE);
    if ((illegal & POLICY_ILLEGAL_NAMECHANGE) != 0)
      queue_push(&q, SOLVER_SOLUTION_REPLACE_NAMECHANGE);
    if (!q.count)
      queue_push(&q, self->type);
    return q;
  }
SWIGINTERN int Solutionelement_illegalreplace(Solutionelement *self){
    if (self->type != SOLVER_SOLUTION_REPLACE || self->p <= 0 || self->rp <= 0)
      return 0;
    return policy_is_illegal(self->solv, self->solv->pool->solvables + self->p, self->solv->pool->solvables + self->rp, 0);
  }

    SWIGINTERN XSolvable *Solutionelement_solvable_get(Solutionelement *e) {
      return new_XSolvable(e->solv->pool, e->p);
    }
    SWIGINTERN XSolvable *Solutionelement_replacement_get(Solutionelement *e) {
      return new_XSolvable(e->solv->pool, e->rp);
    }
    SWIGINTERN int Solutionelement_jobidx_get(Solutionelement *e) {
      if (e->type != SOLVER_SOLUTION_JOB && e->type != SOLVER_SOLUTION_POOLJOB)
        return -1;
      return (e->p - 1) / 2;
    }
  
SWIGINTERN Job *Solutionelement_Job(Solutionelement *self){
    Id extraflags = solver_solutionelement_extrajobflags(self->solv, self->problemid, self->solutionid);
    if (self->type == SOLVER_SOLUTION_JOB || self->type == SOLVER_SOLUTION_POOLJOB)
      return new_Job(self->solv->pool, SOLVER_NOOP, 0);
    if (self->type == SOLVER_SOLUTION_INFARCH || self->type == SOLVER_SOLUTION_DISTUPGRADE || self->type == SOLVER_SOLUTION_BEST)
      return new_Job(self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|SOLVER_NOTBYUSER|extraflags, self->p);
    if (self->type == SOLVER_SOLUTION_REPLACE || self->type == SOLVER_SOLUTION_REPLACE_DOWNGRADE || self->type == SOLVER_SOLUTION_REPLACE_ARCHCHANGE || self->type == SOLVER_SOLUTION_REPLACE_VENDORCHANGE || self->type == SOLVER_SOLUTION_REPLACE_NAMECHANGE)
      return new_Job(self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|SOLVER_NOTBYUSER|extraflags, self->rp);
    if (self->type == SOLVER_SOLUTION_ERASE)
      return new_Job(self->solv->pool, SOLVER_ERASE|SOLVER_SOLVABLE|extraflags, self->p);
    return 0;
  }
SWIGINTERN void delete_Alternative(Alternative *self){
    queue_free(&self->choices);
    solv_free(self);
  }

    SWIGINTERN XSolvable *Alternative_chosen_get(Alternative *a) {
      return new_XSolvable(a->solv->pool, a->chosen_id);
    }
    SWIGINTERN XRule *Alternative_rule_get(Alternative *a) {
      return new_XRule(a->solv, a->rid);
    }
    SWIGINTERN XSolvable *Alternative_depsolvable_get(Alternative *a) {
      return new_XSolvable(a->solv->pool, a->from_id);
    }
    SWIGINTERN Dep *Alternative_dep_get(Alternative *a) {
      return new_Dep(a->solv->pool, a->dep_id);
    }
  
SWIGINTERN Queue Alternative_choices_raw(Alternative *self){
    Queue q;
    queue_init_clone(&q, &self->choices);
    return q;
  }
SWIGINTERN Queue Alternative_choices(Alternative *self){
    int i;
    Queue q;
    queue_init_clone(&q, &self->choices);
    for (i = 0; i < q.count; i++)
      if (q.elements[i] < 0)
        q.elements[i] = -q.elements[i];
    return q;
  }
SWIGINTERN char const *Alternative___str__(Alternative *self){
    return solver_alternative2str(self->solv, self->type, self->type == SOLVER_ALTERNATIVE_TYPE_RULE ? self->rid : self->dep_id, self->from_id);
  }
SWIGINTERN void delete_Transaction(Transaction *self){
    transaction_free(self);
  }
SWIGINTERN bool Transaction_isempty(Transaction *self){
    return self->steps.count == 0;
  }
SWIGINTERN XSolvable *Transaction_othersolvable(Transaction *self,XSolvable *s){
    Id op = transaction_obs_pkg(self, s->id);
    return new_XSolvable(self->pool, op);
  }
SWIGINTERN Queue Transaction_allothersolvables(Transaction *self,XSolvable *s){
    Queue q;
    queue_init(&q);
    transaction_all_obs_pkgs(self, s->id, &q);
    return q;
  }
SWIGINTERN Queue Transaction_classify(Transaction *self,int mode){
    Queue q;
    queue_init(&q);
    transaction_classify(self, mode, &q);
    return q;
  }
SWIGINTERN Queue Transaction_newpackages(Transaction *self){
    Queue q;
    int cut;
    queue_init(&q);
    cut = transaction_installedresult(self, &q);
    queue_truncate(&q, cut);
    return q;
  }
SWIGINTERN Queue Transaction_keptpackages(Transaction *self){
    Queue q;
    int cut;
    queue_init(&q);
    cut = transaction_installedresult(self, &q);
    if (cut)
      queue_deleten(&q, 0, cut);
    return q;
  }
SWIGINTERN Queue Transaction_newsolvables(Transaction *self){
    Queue q;
    int cut;
    queue_init(&q);
    cut = transaction_installedresult(self, &q);
    queue_truncate(&q, cut);
    return q;
  }
SWIGINTERN Queue Transaction_keptsolvables(Transaction *self){
    Queue q;
    int cut;
    queue_init(&q);
    cut = transaction_installedresult(self, &q);
    if (cut)
      queue_deleten(&q, 0, cut);
    return q;
  }
SWIGINTERN Queue Transaction_steps(Transaction *self){
    Queue q;
    queue_init_clone(&q, &self->steps);
    return q;
  }
SWIGINTERN int Transaction_steptype(Transaction *self,XSolvable *s,int mode){
    return transaction_type(self, s->id, mode);
  }
SWIGINTERN long long Transaction_calc_installsizechange(Transaction *self){
    return transaction_calc_installsizechange(self);
  }
SWIGINTERN void Transaction_order(Transaction *self,int flags){
    transaction_order(self, flags);
  }
SWIGINTERN TransactionClass *new_TransactionClass(Transaction *trans,int mode,Id type,int count,Id fromid,Id toid){
    TransactionClass *cl = solv_calloc(1, sizeof(*cl));
    cl->transaction = trans;
    cl->mode = mode;
    cl->type = type;
    cl->count = count;
    cl->fromid = fromid;
    cl->toid = toid;
    return cl;
  }
SWIGINTERN Queue TransactionClass_solvables(TransactionClass *self){
    Queue q;
    queue_init(&q);
    transaction_classify_pkgs(self->transaction, self->mode, self->type, self->fromid, self->toid, &q);
    return q;
  }

    SWIGINTERN const char *TransactionClass_fromstr_get(TransactionClass *cl) {
      return pool_id2str(cl->transaction->pool, cl->fromid);
    }
    SWIGINTERN const char *TransactionClass_tostr_get(TransactionClass *cl) {
      return pool_id2str(cl->transaction->pool, cl->toid);
    }
  
#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_Selection_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Selection::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::pool",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_pool_get",1,SWIGTYPE_p_Selection);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_flags_get(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Selection::flags",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::flags",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_flags_get",1,SWIGTYPE_p_Selection);
  }
  
  result = (int)(int) ((arg1)->flags);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Selection(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Selection::Selection",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::Selection",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Selection",1,SWIGTYPE_p_Pool);
  }
  
  result = (Selection *)new_Selection(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_isempty(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("Selection::isempty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::isempty",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_isempty",1,SWIGTYPE_p_Selection);
  }
  
  result = (bool)Selection_isempty(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_clone(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Selection::clone",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::clone",1,"Selection *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Selection::clone",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_clone",1,SWIGTYPE_p_Selection);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)Selection_clone(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_filter(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  
  SWIG_check_num_args("Selection::filter",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::filter",1,"Selection *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Selection::filter",2,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_filter",1,SWIGTYPE_p_Selection);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_filter",2,SWIGTYPE_p_Selection);
  }
  
  Selection_filter(arg1,arg2);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_add(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  
  SWIG_check_num_args("Selection::add",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::add",1,"Selection *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Selection::add",2,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_add",1,SWIGTYPE_p_Selection);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_add",2,SWIGTYPE_p_Selection);
  }
  
  Selection_add(arg1,arg2);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_add_raw(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  
  SWIG_check_num_args("Selection::add_raw",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::add_raw",1,"Selection *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Selection::add_raw",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Selection::add_raw",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_add_raw",1,SWIGTYPE_p_Selection);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  Selection_add_raw(arg1,arg2,arg3);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_subtract(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  
  SWIG_check_num_args("Selection::subtract",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::subtract",1,"Selection *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Selection::subtract",2,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_subtract",1,SWIGTYPE_p_Selection);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_subtract",2,SWIGTYPE_p_Selection);
  }
  
  Selection_subtract(arg1,arg2);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_select(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  
  SWIG_check_num_args("Selection::select",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::select",1,"Selection *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Selection::select",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Selection::select",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_select",1,SWIGTYPE_p_Selection);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  Selection_select(arg1,(char const *)arg2,arg3);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_matchdeps(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  
  SWIG_check_num_args("Selection::matchdeps",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::matchdeps",1,"Selection *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Selection::matchdeps",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Selection::matchdeps",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Selection::matchdeps",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Selection::matchdeps",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_matchdeps",1,SWIGTYPE_p_Selection);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  Selection_matchdeps(arg1,(char const *)arg2,arg3,arg4,arg5);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_matchdepid(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  DepId arg2 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("Selection::matchdepid",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::matchdepid",1,"Selection *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Selection::matchdepid",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Selection::matchdepid",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Selection::matchdepid",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_matchdepid",1,SWIGTYPE_p_Selection);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Selection_matchdepid", 2, "DepId")
  arg2 = val2;
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  Selection_matchdepid(arg1,arg2,arg3,arg4,arg5);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_matchsolvable(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  
  SWIG_check_num_args("Selection::matchsolvable",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::matchsolvable",1,"Selection *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Selection::matchsolvable",2,"XSolvable *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Selection::matchsolvable",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Selection::matchsolvable",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Selection::matchsolvable",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_matchsolvable",1,SWIGTYPE_p_Selection);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Selection_matchsolvable",2,SWIGTYPE_p_XSolvable);
  }
  
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  Selection_matchsolvable(arg1,arg2,arg3,arg4,arg5);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_jobs(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  int arg2 ;
  Queue result;
  
  SWIG_check_num_args("Selection::jobs",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::jobs",1,"Selection *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Selection::jobs",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_jobs",1,SWIGTYPE_p_Selection);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = Selection_jobs(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 2;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 2)
  {
    Id id = *idp;
#define result resultx
    Job * result = new_Job(arg1->pool, id, idp[1]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Job,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_solvables(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Selection::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::solvables",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_solvables",1,SWIGTYPE_p_Selection);
  }
  
  result = Selection_solvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Selection::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::__str__",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection___tostring",1,SWIGTYPE_p_Selection);
  }
  
  result = (char *)Selection___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Selection_repr(lua_State* L) {
  int SWIG_arg = 0;
  Selection *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Selection::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Selection::__repr__",1,"Selection *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Selection,0))){
    SWIG_fail_ptr("Selection_repr",1,SWIGTYPE_p_Selection);
  }
  
  result = (char *)Selection___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Selection(void *obj) {
Selection *arg1 = (Selection *) obj;
delete_Selection(arg1);
}
static int _proxy__wrap_new_Selection(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Selection);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Selection_attributes[] = {
    { "pool", _wrap_Selection_pool_get, SWIG_Lua_set_immutable },
    { "flags", _wrap_Selection_flags_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Selection_methods[]= {
    { "isempty", _wrap_Selection_isempty},
    { "clone", _wrap_Selection_clone},
    { "filter", _wrap_Selection_filter},
    { "add", _wrap_Selection_add},
    { "add_raw", _wrap_Selection_add_raw},
    { "subtract", _wrap_Selection_subtract},
    { "select", _wrap_Selection_select},
    { "matchdeps", _wrap_Selection_matchdeps},
    { "matchdepid", _wrap_Selection_matchdepid},
    { "matchsolvable", _wrap_Selection_matchsolvable},
    { "jobs", _wrap_Selection_jobs},
    { "solvables", _wrap_Selection_solvables},
    { "__tostring", _wrap_Selection___tostring},
    { "repr", _wrap_Selection_repr},
    {0,0}
};
static swig_lua_method swig_Selection_meta[] = {
    { "__tostring", _wrap_Selection___tostring},
    {0,0}
};

static swig_lua_attribute swig_Selection_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Selection_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SELECTION_NAME", (SELECTION_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_PROVIDES", (SELECTION_PROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_FILELIST", (SELECTION_FILELIST))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_CANON", (SELECTION_CANON))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_DOTARCH", (SELECTION_DOTARCH))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_REL", (SELECTION_REL))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_INSTALLED_ONLY", (SELECTION_INSTALLED_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_GLOB", (SELECTION_GLOB))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_FLAT", (SELECTION_FLAT))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_NOCASE", (SELECTION_NOCASE))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_SKIP_KIND", (SELECTION_SKIP_KIND))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_MATCH_DEPSTR", (SELECTION_MATCH_DEPSTR))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_SOURCE_ONLY", (SELECTION_SOURCE_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_WITH_SOURCE", (SELECTION_WITH_SOURCE))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_WITH_DISABLED", (SELECTION_WITH_DISABLED))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_WITH_BADARCH", (SELECTION_WITH_BADARCH))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_WITH_ALL", (SELECTION_WITH_ALL))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_ADD", (SELECTION_ADD))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_SUBTRACT", (SELECTION_SUBTRACT))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_FILTER", (SELECTION_FILTER))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_FILTER_KEEP_IFEMPTY", (SELECTION_FILTER_KEEP_IFEMPTY))},
    {SWIG_LUA_CONSTTAB_INT("SELECTION_FILTER_SWAPPED", (SELECTION_FILTER_SWAPPED))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Selection_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Selection_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Selection_Sf_SwigStatic = {
    "Selection",
    swig_Selection_Sf_SwigStatic_methods,
    swig_Selection_Sf_SwigStatic_attributes,
    swig_Selection_Sf_SwigStatic_constants,
    swig_Selection_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Selection_bases[] = {0};
static const char *swig_Selection_base_names[] = {0};
static swig_lua_class _wrap_class_Selection = { "Selection", "Selection", &SWIGTYPE_p_Selection,_proxy__wrap_new_Selection, swig_delete_Selection, swig_Selection_methods, swig_Selection_attributes, &swig_Selection_Sf_SwigStatic, swig_Selection_meta, swig_Selection_bases, swig_Selection_base_names };

static int _wrap_Dep_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Dep::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::pool",1,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_pool_get",1,SWIGTYPE_p_Dep);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Dep::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::id",1,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_id_get",1,SWIGTYPE_p_Dep);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Dep(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Dep::Dep",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::Dep",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Dep::Dep",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Dep",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Dep *)new_Dep(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_Rel(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  int arg2 ;
  DepId arg3 ;
  bool arg4 = 1 ;
  int val3 ;
  int ecode3 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Dep::Rel",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::Rel",1,"Dep *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Dep::Rel",2,"int");
  if(lua_gettop(L)>=4 && !lua_isboolean(L,4)) SWIG_fail_arg("Dep::Rel",4,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_Rel",1,SWIGTYPE_p_Dep);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("Dep_Rel", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (lua_toboolean(L, 4)!=0);
  }
  result = (Dep *)Dep_Rel(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_Selection_name(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Dep::Selection_name",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::Selection_name",1,"Dep *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Dep::Selection_name",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_Selection_name",1,SWIGTYPE_p_Dep);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)Dep_Selection_name(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_Selection_provides(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Dep::Selection_provides",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::Selection_provides",1,"Dep *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Dep::Selection_provides",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_Selection_provides",1,SWIGTYPE_p_Dep);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)Dep_Selection_provides(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_str(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Dep::str",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::str",1,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_str",1,SWIGTYPE_p_Dep);
  }
  
  result = (char *)Dep_str(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep___eq(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  Dep *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Dep::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::__eq__",1,"Dep *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Dep::__eq__",2,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep___eq",1,SWIGTYPE_p_Dep);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep___eq",2,SWIGTYPE_p_Dep);
  }
  
  result = (bool)Dep___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep___ne(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  Dep *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Dep::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::__ne__",1,"Dep *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Dep::__ne__",2,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep___ne",1,SWIGTYPE_p_Dep);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep___ne",2,SWIGTYPE_p_Dep);
  }
  
  result = (bool)Dep___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Dep::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::__str__",1,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep___tostring",1,SWIGTYPE_p_Dep);
  }
  
  result = (char *)Dep___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dep_repr(lua_State* L) {
  int SWIG_arg = 0;
  Dep *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Dep::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dep::__repr__",1,"Dep *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dep,0))){
    SWIG_fail_ptr("Dep_repr",1,SWIGTYPE_p_Dep);
  }
  
  result = (char *)Dep___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Dep(void *obj) {
Dep *arg1 = (Dep *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Dep(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Dep);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Dep_attributes[] = {
    { "pool", _wrap_Dep_pool_get, SWIG_Lua_set_immutable },
    { "id", _wrap_Dep_id_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Dep_methods[]= {
    { "Rel", _wrap_Dep_Rel},
    { "Selection_name", _wrap_Dep_Selection_name},
    { "Selection_provides", _wrap_Dep_Selection_provides},
    { "str", _wrap_Dep_str},
    { "__eq", _wrap_Dep___eq},
    { "__ne", _wrap_Dep___ne},
    { "__tostring", _wrap_Dep___tostring},
    { "repr", _wrap_Dep_repr},
    {0,0}
};
static swig_lua_method swig_Dep_meta[] = {
    { "__eq", _wrap_Dep___eq},
    { "__ne", _wrap_Dep___ne},
    { "__tostring", _wrap_Dep___tostring},
    {0,0}
};

static swig_lua_attribute swig_Dep_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Dep_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Dep_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Dep_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Dep_SwigStatic = {
    "Dep",
    swig_Dep_SwigStatic_methods,
    swig_Dep_SwigStatic_attributes,
    swig_Dep_SwigStatic_constants,
    swig_Dep_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Dep_bases[] = {0};
static const char *swig_Dep_base_names[] = {0};
static swig_lua_class _wrap_class_Dep = { "Dep", "Dep", &SWIGTYPE_p_Dep,_proxy__wrap_new_Dep, swig_delete_Dep, swig_Dep_methods, swig_Dep_attributes, &swig_Dep_SwigStatic, swig_Dep_meta, swig_Dep_bases, swig_Dep_base_names };

static int _wrap_new_Dataiterator(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Repo *arg2 = 0 ;
  Id arg3 ;
  Id arg4 ;
  char *arg5 = 0 ;
  int arg6 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Dataiterator::Dataiterator",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dataiterator::Dataiterator",1,"Pool *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Dataiterator::Dataiterator",2,"Repo *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Dataiterator::Dataiterator",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Dataiterator::Dataiterator",4,"Id");
  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("Dataiterator::Dataiterator",5,"char const *");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("Dataiterator::Dataiterator",6,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Dataiterator",1,SWIGTYPE_p_Pool);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("new_Dataiterator",2,SWIGTYPE_p_Repo);
  }
  
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  arg5 = (char *)lua_tostring(L, 5);
  arg6 = (int)lua_tonumber(L, 6);
  result = (Dataiterator *)new_Dataiterator(arg1,arg2,arg3,arg4,(char const *)arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dataiterator___call(lua_State* L) {
  int SWIG_arg = 0;
  Dataiterator *arg1 = 0 ;
  void *arg2 = 0 ;
  void *arg3 = 0 ;
  Datamatch *result = 0 ;
  
  SWIG_check_num_args("Dataiterator::__next__",1,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dataiterator::__next__",1,"Dataiterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dataiterator,0))){
    SWIG_fail_ptr("Dataiterator___call",1,SWIGTYPE_p_Dataiterator);
  }
  
  if(lua_gettop(L)>=2){
    {
      
    }
  }
  if(lua_gettop(L)>=3){
    {
      
    }
  }
  result = (Datamatch *)Dataiterator___next__(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Datamatch,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dataiterator_prepend_keyname(lua_State* L) {
  int SWIG_arg = 0;
  Dataiterator *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("Dataiterator::prepend_keyname",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dataiterator::prepend_keyname",1,"Dataiterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Dataiterator::prepend_keyname",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dataiterator,0))){
    SWIG_fail_ptr("Dataiterator_prepend_keyname",1,SWIGTYPE_p_Dataiterator);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  Dataiterator_prepend_keyname(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Dataiterator_skip_solvable(lua_State* L) {
  int SWIG_arg = 0;
  Dataiterator *arg1 = 0 ;
  
  SWIG_check_num_args("Dataiterator::skip_solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Dataiterator::skip_solvable",1,"Dataiterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Dataiterator,0))){
    SWIG_fail_ptr("Dataiterator_skip_solvable",1,SWIGTYPE_p_Dataiterator);
  }
  
  Dataiterator_skip_solvable(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Dataiterator(void *obj) {
Dataiterator *arg1 = (Dataiterator *) obj;
delete_Dataiterator(arg1);
}
static int _proxy__wrap_new_Dataiterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Dataiterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Dataiterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Dataiterator_methods[]= {
    { "__call", _wrap_Dataiterator___call},
    { "prepend_keyname", _wrap_Dataiterator_prepend_keyname},
    { "skip_solvable", _wrap_Dataiterator_skip_solvable},
    {0,0}
};
static swig_lua_method swig_Dataiterator_meta[] = {
    { "__call", _wrap_Dataiterator___call},
    {0,0}
};

static swig_lua_attribute swig_Dataiterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Dataiterator_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SEARCH_STRING", (SEARCH_STRING))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_STRINGSTART", (SEARCH_STRINGSTART))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_STRINGEND", (SEARCH_STRINGEND))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_SUBSTRING", (SEARCH_SUBSTRING))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_GLOB", (SEARCH_GLOB))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_REGEX", (SEARCH_REGEX))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_NOCASE", (SEARCH_NOCASE))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_FILES", (SEARCH_FILES))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_COMPLETE_FILELIST", (SEARCH_COMPLETE_FILELIST))},
    {SWIG_LUA_CONSTTAB_INT("SEARCH_CHECKSUMS", (SEARCH_CHECKSUMS))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Dataiterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Dataiterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Dataiterator_Sf_SwigStatic = {
    "Dataiterator",
    swig_Dataiterator_Sf_SwigStatic_methods,
    swig_Dataiterator_Sf_SwigStatic_attributes,
    swig_Dataiterator_Sf_SwigStatic_constants,
    swig_Dataiterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Dataiterator_bases[] = {0};
static const char *swig_Dataiterator_base_names[] = {0};
static swig_lua_class _wrap_class_Dataiterator = { "Dataiterator", "Dataiterator", &SWIGTYPE_p_Dataiterator,_proxy__wrap_new_Dataiterator, swig_delete_Dataiterator, swig_Dataiterator_methods, swig_Dataiterator_attributes, &swig_Dataiterator_Sf_SwigStatic, swig_Dataiterator_meta, swig_Dataiterator_bases, swig_Dataiterator_base_names };

static int _wrap_XSolvable_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("XSolvable::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::pool",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_pool_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_id_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::id",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_id_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_XSolvable(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("XSolvable::XSolvable",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::XSolvable",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::XSolvable",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_XSolvable",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XSolvable *)new_XSolvable(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_str(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::str",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::str",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_str",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_str(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_str(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::lookup_str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_str",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_str",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_str",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (char *)XSolvable_lookup_str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_id(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::lookup_id",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_id",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_id",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_id",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Id)XSolvable_lookup_id(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_num(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  unsigned long long arg3 = 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("XSolvable::lookup_num",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_num",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_num",2,"Id");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XSolvable::lookup_num",3,"unsigned long long");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_num",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative");
    arg3 = (unsigned long long)lua_tonumber(L, 3);
  }
  result = (unsigned long long)XSolvable_lookup_num(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_void(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::lookup_void",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_void",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_void",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_void",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (bool)XSolvable_lookup_void(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_checksum(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("XSolvable::lookup_checksum",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_checksum",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_checksum",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_checksum",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Chksum *)XSolvable_lookup_checksum(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_idarray(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Id arg3 = -1 ;
  Queue result;
  
  SWIG_check_num_args("XSolvable::lookup_idarray",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_idarray",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_idarray",2,"Id");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XSolvable::lookup_idarray",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_idarray",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (Id)lua_tonumber(L, 3);
  }
  result = XSolvable_lookup_idarray(arg1,arg2,arg3);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_deparray(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Id arg3 = -1 ;
  Queue result;
  
  SWIG_check_num_args("XSolvable::lookup_deparray",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_deparray",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::lookup_deparray",2,"Id");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XSolvable::lookup_deparray",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_deparray",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (Id)lua_tonumber(L, 3);
  }
  result = XSolvable_lookup_deparray(arg1,arg2,arg3);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Dep * result = new_Dep(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_location(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  unsigned int *arg2 = 0 ;
  unsigned int temp2 ;
  char *result = 0 ;
  
  arg2 = &temp2; 
  SWIG_check_num_args("XSolvable::lookup_location",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_location",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_location",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_lookup_location(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_lookup_sourcepkg(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::lookup_sourcepkg",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::lookup_sourcepkg",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_lookup_sourcepkg",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_lookup_sourcepkg(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_Dataiterator(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("XSolvable::Dataiterator",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::Dataiterator",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::Dataiterator",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("XSolvable::Dataiterator",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("XSolvable::Dataiterator",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_Dataiterator",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (Dataiterator *)XSolvable_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_installable(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::installable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::installable",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_installable",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (bool)XSolvable_installable(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_isinstalled(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::isinstalled",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::isinstalled",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_isinstalled",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (bool)XSolvable_isinstalled(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_name_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("XSolvable::name",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::name",1,"XSolvable *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("XSolvable::name",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_name_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  XSolvable_name_set(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_name_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::name",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_name_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_name_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_nameid_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("XSolvable::nameid",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::nameid",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::nameid",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_nameid_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  XSolvable_nameid_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_nameid_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::nameid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::nameid",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_nameid_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Id)XSolvable_nameid_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_evr_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("XSolvable::evr",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::evr",1,"XSolvable *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("XSolvable::evr",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evr_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  XSolvable_evr_set(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_evr_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::evr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::evr",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evr_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_evr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_evrid_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("XSolvable::evrid",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::evrid",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::evrid",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evrid_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  XSolvable_evrid_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_evrid_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::evrid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::evrid",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evrid_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Id)XSolvable_evrid_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_arch_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("XSolvable::arch",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::arch",1,"XSolvable *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("XSolvable::arch",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_arch_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  XSolvable_arch_set(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_arch_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::arch",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::arch",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_arch_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_arch_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_archid_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("XSolvable::archid",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::archid",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::archid",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_archid_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  XSolvable_archid_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_archid_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::archid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::archid",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_archid_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Id)XSolvable_archid_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_vendor_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("XSolvable::vendor",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::vendor",1,"XSolvable *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("XSolvable::vendor",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_vendor_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  XSolvable_vendor_set(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_vendor_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::vendor",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::vendor",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_vendor_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable_vendor_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_vendorid_set(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("XSolvable::vendorid",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::vendorid",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::vendorid",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_vendorid_set",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  XSolvable_vendorid_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_vendorid_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XSolvable::vendorid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::vendorid",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_vendorid_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Id)XSolvable_vendorid_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_repo_get(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("XSolvable::repo",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::repo",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_repo_get",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (Repo *)XSolvable_repo_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_provides(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  Id arg3 = -1 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_provides",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_provides",1,"XSolvable *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XSolvable::add_provides",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_provides",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_provides", 2, "DepId")
  arg2 = val2;
  if(lua_gettop(L)>=3){
    arg3 = (Id)lua_tonumber(L, 3);
  }
  XSolvable_add_provides(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_obsoletes(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_obsoletes",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_obsoletes",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_obsoletes",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_obsoletes", 2, "DepId")
  arg2 = val2;
  XSolvable_add_obsoletes(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_conflicts(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_conflicts",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_conflicts",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_conflicts",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_conflicts", 2, "DepId")
  arg2 = val2;
  XSolvable_add_conflicts(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_requires(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  Id arg3 = -1 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_requires",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_requires",1,"XSolvable *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XSolvable::add_requires",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_requires",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_requires", 2, "DepId")
  arg2 = val2;
  if(lua_gettop(L)>=3){
    arg3 = (Id)lua_tonumber(L, 3);
  }
  XSolvable_add_requires(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_recommends(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_recommends",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_recommends",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_recommends",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_recommends", 2, "DepId")
  arg2 = val2;
  XSolvable_add_recommends(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_suggests(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_suggests",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_suggests",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_suggests",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_suggests", 2, "DepId")
  arg2 = val2;
  XSolvable_add_suggests(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_supplements(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_supplements",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_supplements",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_supplements",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_supplements", 2, "DepId")
  arg2 = val2;
  XSolvable_add_supplements(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_enhances(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("XSolvable::add_enhances",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_enhances",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_enhances",1,SWIGTYPE_p_XSolvable);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XSolvable_add_enhances", 2, "DepId")
  arg2 = val2;
  XSolvable_add_enhances(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_unset(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("XSolvable::unset",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::unset",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::unset",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_unset",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  XSolvable_unset(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_add_deparray(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  int val3 ;
  int ecode3 ;
  
  SWIG_check_num_args("XSolvable::add_deparray",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::add_deparray",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::add_deparray",2,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("XSolvable::add_deparray",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_add_deparray",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("XSolvable_add_deparray", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (Id)lua_tonumber(L, 4);
  }
  XSolvable_add_deparray(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_Selection(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("XSolvable::Selection",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::Selection",1,"XSolvable *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::Selection",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_Selection",1,SWIGTYPE_p_XSolvable);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)XSolvable_Selection(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_identical(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::identical",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::identical",1,"XSolvable *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XSolvable::identical",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_identical",1,SWIGTYPE_p_XSolvable);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_identical",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (bool)XSolvable_identical(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_evrcmp(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int result;
  
  SWIG_check_num_args("XSolvable::evrcmp",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::evrcmp",1,"XSolvable *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XSolvable::evrcmp",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evrcmp",1,SWIGTYPE_p_XSolvable);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_evrcmp",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (int)XSolvable_evrcmp(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_matchesdep(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  int val3 ;
  int ecode3 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::matchesdep",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::matchesdep",1,"XSolvable *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XSolvable::matchesdep",2,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("XSolvable::matchesdep",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_matchesdep",1,SWIGTYPE_p_XSolvable);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("XSolvable_matchesdep", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (Id)lua_tonumber(L, 4);
  }
  result = (bool)XSolvable_matchesdep(arg1,arg2,arg3,arg4);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable___eq(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::__eq__",1,"XSolvable *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XSolvable::__eq__",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable___eq",1,SWIGTYPE_p_XSolvable);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable___eq",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (bool)XSolvable___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable___ne(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XSolvable::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::__ne__",1,"XSolvable *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XSolvable::__ne__",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable___ne",1,SWIGTYPE_p_XSolvable);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable___ne",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (bool)XSolvable___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable___tostring(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::__str__",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable___tostring",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XSolvable_repr(lua_State* L) {
  int SWIG_arg = 0;
  XSolvable *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XSolvable::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XSolvable::__repr__",1,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("XSolvable_repr",1,SWIGTYPE_p_XSolvable);
  }
  
  result = (char *)XSolvable___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_XSolvable(void *obj) {
XSolvable *arg1 = (XSolvable *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_XSolvable(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_XSolvable);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_XSolvable_attributes[] = {
    { "pool", _wrap_XSolvable_pool_get, SWIG_Lua_set_immutable },
    { "id", _wrap_XSolvable_id_get, SWIG_Lua_set_immutable },
    { "name", _wrap_XSolvable_name_get, _wrap_XSolvable_name_set },
    { "nameid", _wrap_XSolvable_nameid_get, _wrap_XSolvable_nameid_set },
    { "evr", _wrap_XSolvable_evr_get, _wrap_XSolvable_evr_set },
    { "evrid", _wrap_XSolvable_evrid_get, _wrap_XSolvable_evrid_set },
    { "arch", _wrap_XSolvable_arch_get, _wrap_XSolvable_arch_set },
    { "archid", _wrap_XSolvable_archid_get, _wrap_XSolvable_archid_set },
    { "vendor", _wrap_XSolvable_vendor_get, _wrap_XSolvable_vendor_set },
    { "vendorid", _wrap_XSolvable_vendorid_get, _wrap_XSolvable_vendorid_set },
    { "repo", _wrap_XSolvable_repo_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_XSolvable_methods[]= {
    { "str", _wrap_XSolvable_str},
    { "lookup_str", _wrap_XSolvable_lookup_str},
    { "lookup_id", _wrap_XSolvable_lookup_id},
    { "lookup_num", _wrap_XSolvable_lookup_num},
    { "lookup_void", _wrap_XSolvable_lookup_void},
    { "lookup_checksum", _wrap_XSolvable_lookup_checksum},
    { "lookup_idarray", _wrap_XSolvable_lookup_idarray},
    { "lookup_deparray", _wrap_XSolvable_lookup_deparray},
    { "lookup_location", _wrap_XSolvable_lookup_location},
    { "lookup_sourcepkg", _wrap_XSolvable_lookup_sourcepkg},
    { "Dataiterator", _wrap_XSolvable_Dataiterator},
    { "installable", _wrap_XSolvable_installable},
    { "isinstalled", _wrap_XSolvable_isinstalled},
    { "add_provides", _wrap_XSolvable_add_provides},
    { "add_obsoletes", _wrap_XSolvable_add_obsoletes},
    { "add_conflicts", _wrap_XSolvable_add_conflicts},
    { "add_requires", _wrap_XSolvable_add_requires},
    { "add_recommends", _wrap_XSolvable_add_recommends},
    { "add_suggests", _wrap_XSolvable_add_suggests},
    { "add_supplements", _wrap_XSolvable_add_supplements},
    { "add_enhances", _wrap_XSolvable_add_enhances},
    { "unset", _wrap_XSolvable_unset},
    { "add_deparray", _wrap_XSolvable_add_deparray},
    { "Selection", _wrap_XSolvable_Selection},
    { "identical", _wrap_XSolvable_identical},
    { "evrcmp", _wrap_XSolvable_evrcmp},
    { "matchesdep", _wrap_XSolvable_matchesdep},
    { "__eq", _wrap_XSolvable___eq},
    { "__ne", _wrap_XSolvable___ne},
    { "__tostring", _wrap_XSolvable___tostring},
    { "repr", _wrap_XSolvable_repr},
    {0,0}
};
static swig_lua_method swig_XSolvable_meta[] = {
    { "__eq", _wrap_XSolvable___eq},
    { "__ne", _wrap_XSolvable___ne},
    { "__tostring", _wrap_XSolvable___tostring},
    {0,0}
};

static swig_lua_attribute swig_XSolvable_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_XSolvable_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_XSolvable_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_XSolvable_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_XSolvable_Sf_SwigStatic = {
    "XSolvable",
    swig_XSolvable_Sf_SwigStatic_methods,
    swig_XSolvable_Sf_SwigStatic_attributes,
    swig_XSolvable_Sf_SwigStatic_constants,
    swig_XSolvable_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_XSolvable_bases[] = {0};
static const char *swig_XSolvable_base_names[] = {0};
static swig_lua_class _wrap_class_XSolvable = { "XSolvable", "XSolvable", &SWIGTYPE_p_XSolvable,_proxy__wrap_new_XSolvable, swig_delete_XSolvable, swig_XSolvable_methods, swig_XSolvable_attributes, &swig_XSolvable_Sf_SwigStatic, swig_XSolvable_meta, swig_XSolvable_bases, swig_XSolvable_base_names };

static int _wrap_Ruleinfo_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::solv",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_solv_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_type_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Ruleinfo::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::type",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_type_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (int)(int) ((arg1)->type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_dep_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Ruleinfo::dep_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::dep_id",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_dep_id_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (Id)(Id) ((arg1)->dep_id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Ruleinfo(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  Id arg5 ;
  Id arg6 ;
  Ruleinfo *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::Ruleinfo",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::Ruleinfo",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Ruleinfo::Ruleinfo",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Ruleinfo::Ruleinfo",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Ruleinfo::Ruleinfo",4,"Id");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Ruleinfo::Ruleinfo",5,"Id");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("Ruleinfo::Ruleinfo",6,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_Ruleinfo",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  arg5 = (Id)lua_tonumber(L, 5);
  arg6 = (Id)lua_tonumber(L, 6);
  result = (Ruleinfo *)new_Ruleinfo(arg1,arg2,arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_solvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::solvable",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_solvable_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (XSolvable *)Ruleinfo_solvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_othersolvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::othersolvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::othersolvable",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_othersolvable_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (XSolvable *)Ruleinfo_othersolvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_dep_get(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::dep",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::dep",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_dep_get",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (Dep *)Ruleinfo_dep_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo_problemstr(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::problemstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::problemstr",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo_problemstr",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (char *)Ruleinfo_problemstr(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Ruleinfo___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Ruleinfo *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Ruleinfo::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Ruleinfo::__str__",1,"Ruleinfo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Ruleinfo,0))){
    SWIG_fail_ptr("Ruleinfo___tostring",1,SWIGTYPE_p_Ruleinfo);
  }
  
  result = (char *)Ruleinfo___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Ruleinfo(void *obj) {
Ruleinfo *arg1 = (Ruleinfo *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Ruleinfo(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Ruleinfo);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Ruleinfo_attributes[] = {
    { "solv", _wrap_Ruleinfo_solv_get, SWIG_Lua_set_immutable },
    { "type", _wrap_Ruleinfo_type_get, SWIG_Lua_set_immutable },
    { "dep_id", _wrap_Ruleinfo_dep_id_get, SWIG_Lua_set_immutable },
    { "solvable", _wrap_Ruleinfo_solvable_get, SWIG_Lua_set_immutable },
    { "othersolvable", _wrap_Ruleinfo_othersolvable_get, SWIG_Lua_set_immutable },
    { "dep", _wrap_Ruleinfo_dep_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Ruleinfo_methods[]= {
    { "problemstr", _wrap_Ruleinfo_problemstr},
    { "__tostring", _wrap_Ruleinfo___tostring},
    {0,0}
};
static swig_lua_method swig_Ruleinfo_meta[] = {
    { "__tostring", _wrap_Ruleinfo___tostring},
    {0,0}
};

static swig_lua_attribute swig_Ruleinfo_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Ruleinfo_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Ruleinfo_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Ruleinfo_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Ruleinfo_Sf_SwigStatic = {
    "Ruleinfo",
    swig_Ruleinfo_Sf_SwigStatic_methods,
    swig_Ruleinfo_Sf_SwigStatic_attributes,
    swig_Ruleinfo_Sf_SwigStatic_constants,
    swig_Ruleinfo_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Ruleinfo_bases[] = {0};
static const char *swig_Ruleinfo_base_names[] = {0};
static swig_lua_class _wrap_class_Ruleinfo = { "Ruleinfo", "Ruleinfo", &SWIGTYPE_p_Ruleinfo,_proxy__wrap_new_Ruleinfo, swig_delete_Ruleinfo, swig_Ruleinfo_methods, swig_Ruleinfo_attributes, &swig_Ruleinfo_Sf_SwigStatic, swig_Ruleinfo_meta, swig_Ruleinfo_bases, swig_Ruleinfo_base_names };

static int _wrap_XRule_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("XRule::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::solv",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_solv_get",1,SWIGTYPE_p_XRule);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_id_get(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XRule::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::id",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_id_get",1,SWIGTYPE_p_XRule);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_XRule(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  XRule *result = 0 ;
  
  SWIG_check_num_args("XRule::XRule",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::XRule",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRule::XRule",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_XRule",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XRule *)new_XRule(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_type_get(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("XRule::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::type",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_type_get",1,SWIGTYPE_p_XRule);
  }
  
  result = (int)XRule_type_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_info(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Ruleinfo *result = 0 ;
  
  SWIG_check_num_args("XRule::info",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::info",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_info",1,SWIGTYPE_p_XRule);
  }
  
  result = (Ruleinfo *)XRule_info(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_allinfos(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("XRule::allinfos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::allinfos",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_allinfos",1,SWIGTYPE_p_XRule);
  }
  
  result = XRule_allinfos(arg1);
  
  int i;
  int cnt = (&result)->count / 4;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 4)
  {
    Id id = *idp;
#define result resultx
    Ruleinfo * result = new_Ruleinfo(arg1->solv, arg1->id, id, idp[1], idp[2], idp[3]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_get_learnt(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("XRule::get_learnt",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::get_learnt",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_get_learnt",1,SWIGTYPE_p_XRule);
  }
  
  result = XRule_get_learnt(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XRule * result = new_XRule(arg1->solv, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_get_decisionlist(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("XRule::get_decisionlist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::get_decisionlist",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_get_decisionlist",1,SWIGTYPE_p_XRule);
  }
  
  result = XRule_get_decisionlist(arg1);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Decision * result = new_Decision(arg1->solv, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_get_decisionsetlist(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("XRule::get_decisionsetlist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::get_decisionsetlist",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_get_decisionsetlist",1,SWIGTYPE_p_XRule);
  }
  
  result = XRule_get_decisionsetlist(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Decisionset * result = decisionset_fromids(arg1->solv, idp + id, idp[1] - id + 1);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decisionset,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule___eq(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  XRule *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XRule::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::__eq__",1,"XRule *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XRule::__eq__",2,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule___eq",1,SWIGTYPE_p_XRule);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule___eq",2,SWIGTYPE_p_XRule);
  }
  
  result = (bool)XRule___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule___ne(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  XRule *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XRule::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::__ne__",1,"XRule *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XRule::__ne__",2,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule___ne",1,SWIGTYPE_p_XRule);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule___ne",2,SWIGTYPE_p_XRule);
  }
  
  result = (bool)XRule___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRule_repr(lua_State* L) {
  int SWIG_arg = 0;
  XRule *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XRule::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRule::__repr__",1,"XRule *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRule,0))){
    SWIG_fail_ptr("XRule_repr",1,SWIGTYPE_p_XRule);
  }
  
  result = (char *)XRule___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_XRule(void *obj) {
XRule *arg1 = (XRule *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_XRule(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_XRule);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_XRule_attributes[] = {
    { "solv", _wrap_XRule_solv_get, SWIG_Lua_set_immutable },
    { "id", _wrap_XRule_id_get, SWIG_Lua_set_immutable },
    { "type", _wrap_XRule_type_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_XRule_methods[]= {
    { "info", _wrap_XRule_info},
    { "allinfos", _wrap_XRule_allinfos},
    { "get_learnt", _wrap_XRule_get_learnt},
    { "get_decisionlist", _wrap_XRule_get_decisionlist},
    { "get_decisionsetlist", _wrap_XRule_get_decisionsetlist},
    { "__eq", _wrap_XRule___eq},
    { "__ne", _wrap_XRule___ne},
    { "repr", _wrap_XRule_repr},
    {0,0}
};
static swig_lua_method swig_XRule_meta[] = {
    { "__eq", _wrap_XRule___eq},
    { "__ne", _wrap_XRule___ne},
    {0,0}
};

static swig_lua_attribute swig_XRule_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_XRule_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_XRule_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_XRule_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_XRule_Sf_SwigStatic = {
    "XRule",
    swig_XRule_Sf_SwigStatic_methods,
    swig_XRule_Sf_SwigStatic_attributes,
    swig_XRule_Sf_SwigStatic_constants,
    swig_XRule_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_XRule_bases[] = {0};
static const char *swig_XRule_base_names[] = {0};
static swig_lua_class _wrap_class_XRule = { "XRule", "XRule", &SWIGTYPE_p_XRule,_proxy__wrap_new_XRule, swig_delete_XRule, swig_XRule_methods, swig_XRule_attributes, &swig_XRule_Sf_SwigStatic, swig_XRule_meta, swig_XRule_bases, swig_XRule_base_names };

static int _wrap_XRepodata_repo_get(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("XRepodata::repo",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::repo",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_repo_get",1,SWIGTYPE_p_XRepodata);
  }
  
  result = (Repo *)(Repo *) ((arg1)->repo);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_id_get(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XRepodata::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::id",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_id_get",1,SWIGTYPE_p_XRepodata);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_XRepodata(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Id arg2 ;
  XRepodata *result = 0 ;
  
  SWIG_check_num_args("XRepodata::XRepodata",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::XRepodata",1,"Repo *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::XRepodata",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("new_XRepodata",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XRepodata *)new_XRepodata(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRepodata,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_new_handle(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("XRepodata::new_handle",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::new_handle",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_new_handle",1,SWIGTYPE_p_XRepodata);
  }
  
  result = (Id)XRepodata_new_handle(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_id(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  DepId arg4 ;
  int val4 ;
  int ecode4 ;
  
  SWIG_check_num_args("XRepodata::set_id",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_id",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_id",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_id",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_id",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  ecode4 = SWIG_AsValDepId(L, 4, &val4);
  if (!SWIG_IsOK(ecode4)) SWIG_fail_arg("XRepodata_set_id", 4, "DepId")
  arg4 = val4;
  XRepodata_set_id(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_num(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 ;
  
  SWIG_check_num_args("XRepodata::set_num",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_num",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_num",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_num",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("XRepodata::set_num",4,"unsigned long long");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_num",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative");
  arg4 = (unsigned long long)lua_tonumber(L, 4);
  XRepodata_set_num(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_str(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  
  SWIG_check_num_args("XRepodata::set_str",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_str",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_str",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_str",3,"Id");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("XRepodata::set_str",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_str",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  XRepodata_set_str(arg1,arg2,arg3,(char const *)arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_void(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  
  SWIG_check_num_args("XRepodata::set_void",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_void",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_void",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_void",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_void",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  XRepodata_set_void(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_poolstr(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  
  SWIG_check_num_args("XRepodata::set_poolstr",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_poolstr",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_poolstr",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_poolstr",3,"Id");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("XRepodata::set_poolstr",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_poolstr",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  XRepodata_set_poolstr(arg1,arg2,arg3,(char const *)arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_add_idarray(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  DepId arg4 ;
  int val4 ;
  int ecode4 ;
  
  SWIG_check_num_args("XRepodata::add_idarray",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::add_idarray",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::add_idarray",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::add_idarray",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_add_idarray",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  ecode4 = SWIG_AsValDepId(L, 4, &val4);
  if (!SWIG_IsOK(ecode4)) SWIG_fail_arg("XRepodata_add_idarray", 4, "DepId")
  arg4 = val4;
  XRepodata_add_idarray(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_add_flexarray(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  
  SWIG_check_num_args("XRepodata::add_flexarray",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::add_flexarray",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::add_flexarray",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::add_flexarray",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("XRepodata::add_flexarray",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_add_flexarray",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  XRepodata_add_flexarray(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_checksum(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Chksum *arg4 = 0 ;
  
  SWIG_check_num_args("XRepodata::set_checksum",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_checksum",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_checksum",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_checksum",3,"Id");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("XRepodata::set_checksum",4,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_checksum",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("XRepodata_set_checksum",4,SWIGTYPE_p_Chksum);
  }
  
  XRepodata_set_checksum(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_sourcepkg(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  
  SWIG_check_num_args("XRepodata::set_sourcepkg",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_sourcepkg",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_sourcepkg",2,"Id");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("XRepodata::set_sourcepkg",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_sourcepkg",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  XRepodata_set_sourcepkg(arg1,arg2,(char const *)arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_set_location(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  unsigned int arg3 ;
  char *arg4 = 0 ;
  
  SWIG_check_num_args("XRepodata::set_location",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::set_location",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::set_location",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::set_location",3,"unsigned int");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("XRepodata::set_location",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_set_location",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative");
  arg3 = (unsigned int)lua_tonumber(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  XRepodata_set_location(arg1,arg2,arg3,(char const *)arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_unset(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  
  SWIG_check_num_args("XRepodata::unset",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::unset",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::unset",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::unset",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_unset",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  XRepodata_unset(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_str(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XRepodata::lookup_str",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_str",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_str",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_str",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_str",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (char *)XRepodata_lookup_str(arg1,arg2,arg3);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_id(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id result;
  
  SWIG_check_num_args("XRepodata::lookup_id",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_id",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_id",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_id",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_id",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Id)XRepodata_lookup_id(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_num(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 = 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("XRepodata::lookup_num",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_num",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_num",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_num",3,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("XRepodata::lookup_num",4,"unsigned long long");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_num",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  if(lua_gettop(L)>=4){
    SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative");
    arg4 = (unsigned long long)lua_tonumber(L, 4);
  }
  result = (unsigned long long)XRepodata_lookup_num(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_void(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  bool result;
  
  SWIG_check_num_args("XRepodata::lookup_void",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_void",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_void",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_void",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_void",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (bool)XRepodata_lookup_void(arg1,arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_idarray(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Queue result;
  
  SWIG_check_num_args("XRepodata::lookup_idarray",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_idarray",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_idarray",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_idarray",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_idarray",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = XRepodata_lookup_idarray(arg1,arg2,arg3);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_lookup_checksum(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("XRepodata::lookup_checksum",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::lookup_checksum",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::lookup_checksum",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::lookup_checksum",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_lookup_checksum",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Chksum *)XRepodata_lookup_checksum(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_internalize(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  
  SWIG_check_num_args("XRepodata::internalize",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::internalize",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_internalize",1,SWIGTYPE_p_XRepodata);
  }
  
  XRepodata_internalize(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_create_stubs(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  
  SWIG_check_num_args("XRepodata::create_stubs",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::create_stubs",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_create_stubs",1,SWIGTYPE_p_XRepodata);
  }
  
  XRepodata_create_stubs(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_write(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  FILE *arg2 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("XRepodata::write",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::write",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_write",1,SWIGTYPE_p_XRepodata);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XRepodata_write", 2, "FILE *");
  arg2 = val2;
  result = (bool)XRepodata_write(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_str2dir(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  Id result;
  
  SWIG_check_num_args("XRepodata::str2dir",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::str2dir",1,"XRepodata *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("XRepodata::str2dir",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isboolean(L,3)) SWIG_fail_arg("XRepodata::str2dir",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_str2dir",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (lua_toboolean(L, 3)!=0);
  }
  result = (Id)XRepodata_str2dir(arg1,(char const *)arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_dir2str(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XRepodata::dir2str",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::dir2str",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::dir2str",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("XRepodata::dir2str",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_dir2str",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  result = (char *)XRepodata_dir2str(arg1,arg2,(char const *)arg3);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_add_dirstr(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  char *arg5 = 0 ;
  
  SWIG_check_num_args("XRepodata::add_dirstr",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::add_dirstr",1,"XRepodata *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("XRepodata::add_dirstr",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::add_dirstr",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("XRepodata::add_dirstr",4,"Id");
  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("XRepodata::add_dirstr",5,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_add_dirstr",1,SWIGTYPE_p_XRepodata);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  arg5 = (char *)lua_tostring(L, 5);
  XRepodata_add_dirstr(arg1,arg2,arg3,arg4,(char const *)arg5);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_add_solv(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("XRepodata::add_solv",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::add_solv",1,"XRepodata *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("XRepodata::add_solv",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_add_solv",1,SWIGTYPE_p_XRepodata);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("XRepodata_add_solv", 2, "FILE *");
  arg2 = val2;
  if(lua_gettop(L)>=3){
    arg3 = (int)lua_tonumber(L, 3);
  }
  result = (bool)XRepodata_add_solv(arg1,arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_extend_to_repo(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  
  SWIG_check_num_args("XRepodata::extend_to_repo",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::extend_to_repo",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_extend_to_repo",1,SWIGTYPE_p_XRepodata);
  }
  
  XRepodata_extend_to_repo(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata___eq(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  XRepodata *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XRepodata::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::__eq__",1,"XRepodata *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XRepodata::__eq__",2,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata___eq",1,SWIGTYPE_p_XRepodata);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata___eq",2,SWIGTYPE_p_XRepodata);
  }
  
  result = (bool)XRepodata___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata___ne(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  XRepodata *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("XRepodata::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::__ne__",1,"XRepodata *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XRepodata::__ne__",2,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata___ne",1,SWIGTYPE_p_XRepodata);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata___ne",2,SWIGTYPE_p_XRepodata);
  }
  
  result = (bool)XRepodata___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_XRepodata_repr(lua_State* L) {
  int SWIG_arg = 0;
  XRepodata *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("XRepodata::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XRepodata::__repr__",1,"XRepodata *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XRepodata,0))){
    SWIG_fail_ptr("XRepodata_repr",1,SWIGTYPE_p_XRepodata);
  }
  
  result = (char *)XRepodata___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_XRepodata(void *obj) {
XRepodata *arg1 = (XRepodata *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_XRepodata(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_XRepodata);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_XRepodata_attributes[] = {
    { "repo", _wrap_XRepodata_repo_get, SWIG_Lua_set_immutable },
    { "id", _wrap_XRepodata_id_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_XRepodata_methods[]= {
    { "new_handle", _wrap_XRepodata_new_handle},
    { "set_id", _wrap_XRepodata_set_id},
    { "set_num", _wrap_XRepodata_set_num},
    { "set_str", _wrap_XRepodata_set_str},
    { "set_void", _wrap_XRepodata_set_void},
    { "set_poolstr", _wrap_XRepodata_set_poolstr},
    { "add_idarray", _wrap_XRepodata_add_idarray},
    { "add_flexarray", _wrap_XRepodata_add_flexarray},
    { "set_checksum", _wrap_XRepodata_set_checksum},
    { "set_sourcepkg", _wrap_XRepodata_set_sourcepkg},
    { "set_location", _wrap_XRepodata_set_location},
    { "unset", _wrap_XRepodata_unset},
    { "lookup_str", _wrap_XRepodata_lookup_str},
    { "lookup_id", _wrap_XRepodata_lookup_id},
    { "lookup_num", _wrap_XRepodata_lookup_num},
    { "lookup_void", _wrap_XRepodata_lookup_void},
    { "lookup_idarray", _wrap_XRepodata_lookup_idarray},
    { "lookup_checksum", _wrap_XRepodata_lookup_checksum},
    { "internalize", _wrap_XRepodata_internalize},
    { "create_stubs", _wrap_XRepodata_create_stubs},
    { "write", _wrap_XRepodata_write},
    { "str2dir", _wrap_XRepodata_str2dir},
    { "dir2str", _wrap_XRepodata_dir2str},
    { "add_dirstr", _wrap_XRepodata_add_dirstr},
    { "add_solv", _wrap_XRepodata_add_solv},
    { "extend_to_repo", _wrap_XRepodata_extend_to_repo},
    { "__eq", _wrap_XRepodata___eq},
    { "__ne", _wrap_XRepodata___ne},
    { "repr", _wrap_XRepodata_repr},
    {0,0}
};
static swig_lua_method swig_XRepodata_meta[] = {
    { "__eq", _wrap_XRepodata___eq},
    { "__ne", _wrap_XRepodata___ne},
    {0,0}
};

static swig_lua_attribute swig_XRepodata_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_XRepodata_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_XRepodata_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_XRepodata_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_XRepodata_Sf_SwigStatic = {
    "XRepodata",
    swig_XRepodata_Sf_SwigStatic_methods,
    swig_XRepodata_Sf_SwigStatic_attributes,
    swig_XRepodata_Sf_SwigStatic_constants,
    swig_XRepodata_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_XRepodata_bases[] = {0};
static const char *swig_XRepodata_base_names[] = {0};
static swig_lua_class _wrap_class_XRepodata = { "XRepodata", "XRepodata", &SWIGTYPE_p_XRepodata,_proxy__wrap_new_XRepodata, swig_delete_XRepodata, swig_XRepodata_methods, swig_XRepodata_attributes, &swig_XRepodata_Sf_SwigStatic, swig_XRepodata_meta, swig_XRepodata_bases, swig_XRepodata_base_names };

static int _wrap_new_Pool_solvable_iterator(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool_solvable_iterator::Pool_solvable_iterator",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_solvable_iterator::Pool_solvable_iterator",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Pool_solvable_iterator",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_solvable_iterator *)new_Pool_solvable_iterator(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvable_iterator___call(lua_State* L) {
  int SWIG_arg = 0;
  Pool_solvable_iterator *arg1 = 0 ;
  void *arg2 = 0 ;
  void *arg3 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Pool_solvable_iterator::__next__",1,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_solvable_iterator::__next__",1,"Pool_solvable_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_solvable_iterator,0))){
    SWIG_fail_ptr("Pool_solvable_iterator___call",1,SWIGTYPE_p_Pool_solvable_iterator);
  }
  
  if(lua_gettop(L)>=2){
    {
      
    }
  }
  if(lua_gettop(L)>=3){
    {
      
    }
  }
  result = (XSolvable *)Pool_solvable_iterator___next__(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvable_iterator___index(lua_State* L) {
  int SWIG_arg = 0;
  Pool_solvable_iterator *arg1 = 0 ;
  Id arg2 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Pool_solvable_iterator::__getitem__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_solvable_iterator::__getitem__",1,"Pool_solvable_iterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool_solvable_iterator::__getitem__",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_solvable_iterator,0))){
    SWIG_fail_ptr("Pool_solvable_iterator___index",1,SWIGTYPE_p_Pool_solvable_iterator);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XSolvable *)Pool_solvable_iterator___getitem__(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvable_iterator___len__(lua_State* L) {
  int SWIG_arg = 0;
  Pool_solvable_iterator *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Pool_solvable_iterator::__len__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_solvable_iterator::__len__",1,"Pool_solvable_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_solvable_iterator,0))){
    SWIG_fail_ptr("Pool_solvable_iterator___len__",1,SWIGTYPE_p_Pool_solvable_iterator);
  }
  
  result = (int)Pool_solvable_iterator___len__(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Pool_solvable_iterator(void *obj) {
Pool_solvable_iterator *arg1 = (Pool_solvable_iterator *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Pool_solvable_iterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Pool_solvable_iterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Pool_solvable_iterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Pool_solvable_iterator_methods[]= {
    { "__call", _wrap_Pool_solvable_iterator___call},
    { "__index", _wrap_Pool_solvable_iterator___index},
    { "__len__", _wrap_Pool_solvable_iterator___len__},
    {0,0}
};
static swig_lua_method swig_Pool_solvable_iterator_meta[] = {
    { "__call", _wrap_Pool_solvable_iterator___call},
    { "__index", _wrap_Pool_solvable_iterator___index},
    { "__len__", _wrap_Pool_solvable_iterator___len__},
    {0,0}
};

static swig_lua_attribute swig_Pool_solvable_iterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Pool_solvable_iterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Pool_solvable_iterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Pool_solvable_iterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Pool_solvable_iterator_Sf_SwigStatic = {
    "Pool_solvable_iterator",
    swig_Pool_solvable_iterator_Sf_SwigStatic_methods,
    swig_Pool_solvable_iterator_Sf_SwigStatic_attributes,
    swig_Pool_solvable_iterator_Sf_SwigStatic_constants,
    swig_Pool_solvable_iterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Pool_solvable_iterator_bases[] = {0};
static const char *swig_Pool_solvable_iterator_base_names[] = {0};
static swig_lua_class _wrap_class_Pool_solvable_iterator = { "Pool_solvable_iterator", "Pool_solvable_iterator", &SWIGTYPE_p_Pool_solvable_iterator,_proxy__wrap_new_Pool_solvable_iterator, swig_delete_Pool_solvable_iterator, swig_Pool_solvable_iterator_methods, swig_Pool_solvable_iterator_attributes, &swig_Pool_solvable_iterator_Sf_SwigStatic, swig_Pool_solvable_iterator_meta, swig_Pool_solvable_iterator_bases, swig_Pool_solvable_iterator_base_names };

static int _wrap_new_Pool_repo_iterator(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool_repo_iterator::Pool_repo_iterator",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_repo_iterator::Pool_repo_iterator",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Pool_repo_iterator",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_repo_iterator *)new_Pool_repo_iterator(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_repo_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_repo_iterator___call(lua_State* L) {
  int SWIG_arg = 0;
  Pool_repo_iterator *arg1 = 0 ;
  void *arg2 = 0 ;
  void *arg3 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Pool_repo_iterator::__next__",1,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_repo_iterator::__next__",1,"Pool_repo_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_repo_iterator,0))){
    SWIG_fail_ptr("Pool_repo_iterator___call",1,SWIGTYPE_p_Pool_repo_iterator);
  }
  
  if(lua_gettop(L)>=2){
    {
      
    }
  }
  if(lua_gettop(L)>=3){
    {
      
    }
  }
  result = (Repo *)Pool_repo_iterator___next__(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_repo_iterator___index(lua_State* L) {
  int SWIG_arg = 0;
  Pool_repo_iterator *arg1 = 0 ;
  Id arg2 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Pool_repo_iterator::__getitem__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_repo_iterator::__getitem__",1,"Pool_repo_iterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool_repo_iterator::__getitem__",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_repo_iterator,0))){
    SWIG_fail_ptr("Pool_repo_iterator___index",1,SWIGTYPE_p_Pool_repo_iterator);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Repo *)Pool_repo_iterator___getitem__(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_repo_iterator___len__(lua_State* L) {
  int SWIG_arg = 0;
  Pool_repo_iterator *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Pool_repo_iterator::__len__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool_repo_iterator::__len__",1,"Pool_repo_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool_repo_iterator,0))){
    SWIG_fail_ptr("Pool_repo_iterator___len__",1,SWIGTYPE_p_Pool_repo_iterator);
  }
  
  result = (int)Pool_repo_iterator___len__(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Pool_repo_iterator(void *obj) {
Pool_repo_iterator *arg1 = (Pool_repo_iterator *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Pool_repo_iterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Pool_repo_iterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Pool_repo_iterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Pool_repo_iterator_methods[]= {
    { "__call", _wrap_Pool_repo_iterator___call},
    { "__index", _wrap_Pool_repo_iterator___index},
    { "__len__", _wrap_Pool_repo_iterator___len__},
    {0,0}
};
static swig_lua_method swig_Pool_repo_iterator_meta[] = {
    { "__call", _wrap_Pool_repo_iterator___call},
    { "__index", _wrap_Pool_repo_iterator___index},
    { "__len__", _wrap_Pool_repo_iterator___len__},
    {0,0}
};

static swig_lua_attribute swig_Pool_repo_iterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Pool_repo_iterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Pool_repo_iterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Pool_repo_iterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Pool_repo_iterator_Sf_SwigStatic = {
    "Pool_repo_iterator",
    swig_Pool_repo_iterator_Sf_SwigStatic_methods,
    swig_Pool_repo_iterator_Sf_SwigStatic_attributes,
    swig_Pool_repo_iterator_Sf_SwigStatic_constants,
    swig_Pool_repo_iterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Pool_repo_iterator_bases[] = {0};
static const char *swig_Pool_repo_iterator_base_names[] = {0};
static swig_lua_class _wrap_class_Pool_repo_iterator = { "Pool_repo_iterator", "Pool_repo_iterator", &SWIGTYPE_p_Pool_repo_iterator,_proxy__wrap_new_Pool_repo_iterator, swig_delete_Pool_repo_iterator, swig_Pool_repo_iterator_methods, swig_Pool_repo_iterator_attributes, &swig_Pool_repo_iterator_Sf_SwigStatic, swig_Pool_repo_iterator_meta, swig_Pool_repo_iterator_bases, swig_Pool_repo_iterator_base_names };

static int _wrap_new_Repo_solvable_iterator(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Repo_solvable_iterator::Repo_solvable_iterator",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo_solvable_iterator::Repo_solvable_iterator",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("new_Repo_solvable_iterator",1,SWIGTYPE_p_Repo);
  }
  
  result = (Repo_solvable_iterator *)new_Repo_solvable_iterator(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_solvable_iterator___call(lua_State* L) {
  int SWIG_arg = 0;
  Repo_solvable_iterator *arg1 = 0 ;
  void *arg2 = 0 ;
  void *arg3 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Repo_solvable_iterator::__next__",1,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo_solvable_iterator::__next__",1,"Repo_solvable_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo_solvable_iterator,0))){
    SWIG_fail_ptr("Repo_solvable_iterator___call",1,SWIGTYPE_p_Repo_solvable_iterator);
  }
  
  if(lua_gettop(L)>=2){
    {
      
    }
  }
  if(lua_gettop(L)>=3){
    {
      
    }
  }
  result = (XSolvable *)Repo_solvable_iterator___next__(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_solvable_iterator___index(lua_State* L) {
  int SWIG_arg = 0;
  Repo_solvable_iterator *arg1 = 0 ;
  Id arg2 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Repo_solvable_iterator::__getitem__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo_solvable_iterator::__getitem__",1,"Repo_solvable_iterator *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Repo_solvable_iterator::__getitem__",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo_solvable_iterator,0))){
    SWIG_fail_ptr("Repo_solvable_iterator___index",1,SWIGTYPE_p_Repo_solvable_iterator);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XSolvable *)Repo_solvable_iterator___getitem__(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_solvable_iterator___len__(lua_State* L) {
  int SWIG_arg = 0;
  Repo_solvable_iterator *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Repo_solvable_iterator::__len__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo_solvable_iterator::__len__",1,"Repo_solvable_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo_solvable_iterator,0))){
    SWIG_fail_ptr("Repo_solvable_iterator___len__",1,SWIGTYPE_p_Repo_solvable_iterator);
  }
  
  result = (int)Repo_solvable_iterator___len__(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Repo_solvable_iterator(void *obj) {
Repo_solvable_iterator *arg1 = (Repo_solvable_iterator *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Repo_solvable_iterator(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Repo_solvable_iterator);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Repo_solvable_iterator_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_Repo_solvable_iterator_methods[]= {
    { "__call", _wrap_Repo_solvable_iterator___call},
    { "__index", _wrap_Repo_solvable_iterator___index},
    { "__len__", _wrap_Repo_solvable_iterator___len__},
    {0,0}
};
static swig_lua_method swig_Repo_solvable_iterator_meta[] = {
    { "__call", _wrap_Repo_solvable_iterator___call},
    { "__index", _wrap_Repo_solvable_iterator___index},
    { "__len__", _wrap_Repo_solvable_iterator___len__},
    {0,0}
};

static swig_lua_attribute swig_Repo_solvable_iterator_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Repo_solvable_iterator_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Repo_solvable_iterator_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Repo_solvable_iterator_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Repo_solvable_iterator_Sf_SwigStatic = {
    "Repo_solvable_iterator",
    swig_Repo_solvable_iterator_Sf_SwigStatic_methods,
    swig_Repo_solvable_iterator_Sf_SwigStatic_attributes,
    swig_Repo_solvable_iterator_Sf_SwigStatic_constants,
    swig_Repo_solvable_iterator_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Repo_solvable_iterator_bases[] = {0};
static const char *swig_Repo_solvable_iterator_base_names[] = {0};
static swig_lua_class _wrap_class_Repo_solvable_iterator = { "Repo_solvable_iterator", "Repo_solvable_iterator", &SWIGTYPE_p_Repo_solvable_iterator,_proxy__wrap_new_Repo_solvable_iterator, swig_delete_Repo_solvable_iterator, swig_Repo_solvable_iterator_methods, swig_Repo_solvable_iterator_attributes, &swig_Repo_solvable_iterator_Sf_SwigStatic, swig_Repo_solvable_iterator_meta, swig_Repo_solvable_iterator_bases, swig_Repo_solvable_iterator_base_names };

static int _wrap_Datamatch_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Datamatch::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::pool",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_pool_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_repo_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Datamatch::repo",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::repo",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_repo_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Repo *)(Repo *) ((arg1)->repo);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_solvid_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Datamatch::solvid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::solvid",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_solvid_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Id)(Id) ((arg1)->solvid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_solvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Datamatch::solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::solvable",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_solvable_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (XSolvable *)Datamatch_solvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_key_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Datamatch::key_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::key_id",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_key_id_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Id)Datamatch_key_id_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_key_idstr_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datamatch::key_idstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::key_idstr",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_key_idstr_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (char *)Datamatch_key_idstr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_type_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Datamatch::type_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::type_id",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_type_id_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Id)Datamatch_type_id_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_type_idstr_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datamatch::type_idstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::type_idstr",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_type_idstr_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (char *)Datamatch_type_idstr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Datamatch::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::id",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_id_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Id)Datamatch_id_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_idstr_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datamatch::idstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::idstr",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_idstr_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (char *)Datamatch_idstr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_str_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datamatch::str",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::str",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_str_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (char *)Datamatch_str_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_dep_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Datamatch::dep",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::dep",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_dep_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Dep *)Datamatch_dep_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_binary_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  BinaryBlob result;
  
  SWIG_check_num_args("Datamatch::binary",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::binary",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_binary_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = Datamatch_binary_get(arg1);
  if ((&result)->data) {
    lua_pushlstring(L, (&result)->data, (&result)->len);
  } else {
    lua_pushnil(L);
  }
  SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_num_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("Datamatch::num",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::num",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_num_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (unsigned long long)Datamatch_num_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_num2_get(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  unsigned int result;
  
  SWIG_check_num_args("Datamatch::num2",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::num2",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_num2_get",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (unsigned int)Datamatch_num2_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_pos(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Datapos *result = 0 ;
  
  SWIG_check_num_args("Datamatch::pos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::pos",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_pos",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Datapos *)Datamatch_pos(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Datapos,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch_parentpos(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  Datapos *result = 0 ;
  
  SWIG_check_num_args("Datamatch::parentpos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::parentpos",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch_parentpos",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (Datapos *)Datamatch_parentpos(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Datapos,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datamatch___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Datamatch *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datamatch::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datamatch::__str__",1,"Datamatch *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datamatch,0))){
    SWIG_fail_ptr("Datamatch___tostring",1,SWIGTYPE_p_Datamatch);
  }
  
  result = (char *)Datamatch___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Datamatch(void *obj) {
Datamatch *arg1 = (Datamatch *) obj;
delete_Datamatch(arg1);
}
static swig_lua_attribute swig_Datamatch_attributes[] = {
    { "pool", _wrap_Datamatch_pool_get, SWIG_Lua_set_immutable },
    { "repo", _wrap_Datamatch_repo_get, SWIG_Lua_set_immutable },
    { "solvid", _wrap_Datamatch_solvid_get, SWIG_Lua_set_immutable },
    { "solvable", _wrap_Datamatch_solvable_get, SWIG_Lua_set_immutable },
    { "key_id", _wrap_Datamatch_key_id_get, SWIG_Lua_set_immutable },
    { "key_idstr", _wrap_Datamatch_key_idstr_get, SWIG_Lua_set_immutable },
    { "type_id", _wrap_Datamatch_type_id_get, SWIG_Lua_set_immutable },
    { "type_idstr", _wrap_Datamatch_type_idstr_get, SWIG_Lua_set_immutable },
    { "id", _wrap_Datamatch_id_get, SWIG_Lua_set_immutable },
    { "idstr", _wrap_Datamatch_idstr_get, SWIG_Lua_set_immutable },
    { "str", _wrap_Datamatch_str_get, SWIG_Lua_set_immutable },
    { "dep", _wrap_Datamatch_dep_get, SWIG_Lua_set_immutable },
    { "binary", _wrap_Datamatch_binary_get, SWIG_Lua_set_immutable },
    { "num", _wrap_Datamatch_num_get, SWIG_Lua_set_immutable },
    { "num2", _wrap_Datamatch_num2_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Datamatch_methods[]= {
    { "pos", _wrap_Datamatch_pos},
    { "parentpos", _wrap_Datamatch_parentpos},
    { "__tostring", _wrap_Datamatch___tostring},
    {0,0}
};
static swig_lua_method swig_Datamatch_meta[] = {
    { "__tostring", _wrap_Datamatch___tostring},
    {0,0}
};

static swig_lua_attribute swig_Datamatch_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Datamatch_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Datamatch_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Datamatch_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Datamatch_Sf_SwigStatic = {
    "Datamatch",
    swig_Datamatch_Sf_SwigStatic_methods,
    swig_Datamatch_Sf_SwigStatic_attributes,
    swig_Datamatch_Sf_SwigStatic_constants,
    swig_Datamatch_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Datamatch_bases[] = {0};
static const char *swig_Datamatch_base_names[] = {0};
static swig_lua_class _wrap_class_Datamatch = { "Datamatch", "Datamatch", &SWIGTYPE_p_Datamatch,0, swig_delete_Datamatch, swig_Datamatch_methods, swig_Datamatch_attributes, &swig_Datamatch_Sf_SwigStatic, swig_Datamatch_meta, swig_Datamatch_bases, swig_Datamatch_base_names };

static int _wrap_Datapos_repo_get(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Datapos::repo",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::repo",1,"Datapos *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_repo_get",1,SWIGTYPE_p_Datapos);
  }
  
  result = (Repo *)(Repo *) ((arg1)->repo);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_id(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  Id result;
  
  SWIG_check_num_args("Datapos::lookup_id",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_id",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_id",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_id",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Id)Datapos_lookup_id(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_str(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datapos::lookup_str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_str",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_str",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_str",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (char *)Datapos_lookup_str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_num(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  unsigned long long arg3 = 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("Datapos::lookup_num",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_num",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_num",2,"Id");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("Datapos::lookup_num",3,"unsigned long long");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_num",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative");
    arg3 = (unsigned long long)lua_tonumber(L, 3);
  }
  result = (unsigned long long)Datapos_lookup_num(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_void(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  bool result;
  
  SWIG_check_num_args("Datapos::lookup_void",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_void",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_void",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_void",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (bool)Datapos_lookup_void(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_checksum(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("Datapos::lookup_checksum",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_checksum",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_checksum",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_checksum",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Chksum *)Datapos_lookup_checksum(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_deltaseq(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Datapos::lookup_deltaseq",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_deltaseq",1,"Datapos *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_deltaseq",1,SWIGTYPE_p_Datapos);
  }
  
  result = (char *)Datapos_lookup_deltaseq(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_deltalocation(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  unsigned int *arg2 = 0 ;
  unsigned int temp2 ;
  char *result = 0 ;
  
  arg2 = &temp2; 
  SWIG_check_num_args("Datapos::lookup_deltalocation",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_deltalocation",1,"Datapos *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_deltalocation",1,SWIGTYPE_p_Datapos);
  }
  
  result = (char *)Datapos_lookup_deltalocation(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_lookup_idarray(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  Queue result;
  
  SWIG_check_num_args("Datapos::lookup_idarray",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::lookup_idarray",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::lookup_idarray",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_lookup_idarray",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = Datapos_lookup_idarray(arg1,arg2);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Datapos_Dataiterator(lua_State* L) {
  int SWIG_arg = 0;
  Datapos *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Datapos::Dataiterator",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Datapos::Dataiterator",1,"Datapos *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Datapos::Dataiterator",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Datapos::Dataiterator",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Datapos::Dataiterator",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Datapos,0))){
    SWIG_fail_ptr("Datapos_Dataiterator",1,SWIGTYPE_p_Datapos);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (Dataiterator *)Datapos_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Datapos(void *obj) {
Datapos *arg1 = (Datapos *) obj;
free((char *) arg1);
}
static swig_lua_attribute swig_Datapos_attributes[] = {
    { "repo", _wrap_Datapos_repo_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Datapos_methods[]= {
    { "lookup_id", _wrap_Datapos_lookup_id},
    { "lookup_str", _wrap_Datapos_lookup_str},
    { "lookup_num", _wrap_Datapos_lookup_num},
    { "lookup_void", _wrap_Datapos_lookup_void},
    { "lookup_checksum", _wrap_Datapos_lookup_checksum},
    { "lookup_deltaseq", _wrap_Datapos_lookup_deltaseq},
    { "lookup_deltalocation", _wrap_Datapos_lookup_deltalocation},
    { "lookup_idarray", _wrap_Datapos_lookup_idarray},
    { "Dataiterator", _wrap_Datapos_Dataiterator},
    {0,0}
};
static swig_lua_method swig_Datapos_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Datapos_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Datapos_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Datapos_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Datapos_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Datapos_Sf_SwigStatic = {
    "Datapos",
    swig_Datapos_Sf_SwigStatic_methods,
    swig_Datapos_Sf_SwigStatic_attributes,
    swig_Datapos_Sf_SwigStatic_constants,
    swig_Datapos_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Datapos_bases[] = {0};
static const char *swig_Datapos_base_names[] = {0};
static swig_lua_class _wrap_class_Datapos = { "Datapos", "Datapos", &SWIGTYPE_p_Datapos,0, swig_delete_Datapos, swig_Datapos_methods, swig_Datapos_attributes, &swig_Datapos_Sf_SwigStatic, swig_Datapos_meta, swig_Datapos_bases, swig_Datapos_base_names };

static int _wrap_Job_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Job::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::pool",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_pool_get",1,SWIGTYPE_p_Job);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_how_set(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Job::how",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::how",1,"Job *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Job::how",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_how_set",1,SWIGTYPE_p_Job);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  if (arg1) (arg1)->how = arg2;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_how_get(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Job::how",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::how",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_how_get",1,SWIGTYPE_p_Job);
  }
  
  result = (int) ((arg1)->how);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_what_set(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Id arg2 ;
  
  SWIG_check_num_args("Job::what",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::what",1,"Job *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Job::what",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_what_set",1,SWIGTYPE_p_Job);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if (arg1) (arg1)->what = arg2;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_what_get(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Job::what",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::what",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_what_get",1,SWIGTYPE_p_Job);
  }
  
  result = (Id) ((arg1)->what);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Job(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  Job *result = 0 ;
  
  SWIG_check_num_args("Job::Job",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::Job",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Job::Job",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Job::Job",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("new_Job",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Job *)new_Job(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Job,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_solvables(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Job::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::solvables",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_solvables",1,SWIGTYPE_p_Job);
  }
  
  result = Job_solvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_isemptyupdate(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("Job::isemptyupdate",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::isemptyupdate",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_isemptyupdate",1,SWIGTYPE_p_Job);
  }
  
  result = (bool)Job_isemptyupdate(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job___eq(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Job *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Job::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::__eq__",1,"Job *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Job::__eq__",2,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job___eq",1,SWIGTYPE_p_Job);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job___eq",2,SWIGTYPE_p_Job);
  }
  
  result = (bool)Job___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job___ne(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  Job *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Job::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::__ne__",1,"Job *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Job::__ne__",2,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job___ne",1,SWIGTYPE_p_Job);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job___ne",2,SWIGTYPE_p_Job);
  }
  
  result = (bool)Job___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Job::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::__str__",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job___tostring",1,SWIGTYPE_p_Job);
  }
  
  result = (char *)Job___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Job_repr(lua_State* L) {
  int SWIG_arg = 0;
  Job *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Job::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Job::__repr__",1,"Job *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Job,0))){
    SWIG_fail_ptr("Job_repr",1,SWIGTYPE_p_Job);
  }
  
  result = (char *)Job___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Job(void *obj) {
Job *arg1 = (Job *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Job(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Job);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Job_attributes[] = {
    { "pool", _wrap_Job_pool_get, SWIG_Lua_set_immutable },
    { "how", _wrap_Job_how_get, _wrap_Job_how_set },
    { "what", _wrap_Job_what_get, _wrap_Job_what_set },
    {0,0,0}
};
static swig_lua_method swig_Job_methods[]= {
    { "solvables", _wrap_Job_solvables},
    { "isemptyupdate", _wrap_Job_isemptyupdate},
    { "__eq", _wrap_Job___eq},
    { "__ne", _wrap_Job___ne},
    { "__tostring", _wrap_Job___tostring},
    { "repr", _wrap_Job_repr},
    {0,0}
};
static swig_lua_method swig_Job_meta[] = {
    { "__eq", _wrap_Job___eq},
    { "__ne", _wrap_Job___ne},
    { "__tostring", _wrap_Job___tostring},
    {0,0}
};

static swig_lua_attribute swig_Job_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Job_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE", (SOLVER_SOLVABLE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE_NAME", (SOLVER_SOLVABLE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE_PROVIDES", (SOLVER_SOLVABLE_PROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE_ONE_OF", (SOLVER_SOLVABLE_ONE_OF))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE_REPO", (SOLVER_SOLVABLE_REPO))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLVABLE_ALL", (SOLVER_SOLVABLE_ALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SELECTMASK", (SOLVER_SELECTMASK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_NOOP", (SOLVER_NOOP))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_INSTALL", (SOLVER_INSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ERASE", (SOLVER_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_UPDATE", (SOLVER_UPDATE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_WEAKENDEPS", (SOLVER_WEAKENDEPS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_MULTIVERSION", (SOLVER_MULTIVERSION))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_LOCK", (SOLVER_LOCK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_DISTUPGRADE", (SOLVER_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_VERIFY", (SOLVER_VERIFY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_DROP_ORPHANED", (SOLVER_DROP_ORPHANED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_USERINSTALLED", (SOLVER_USERINSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ALLOWUNINSTALL", (SOLVER_ALLOWUNINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FAVOR", (SOLVER_FAVOR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_DISFAVOR", (SOLVER_DISFAVOR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_EXCLUDEFROMWEAK", (SOLVER_EXCLUDEFROMWEAK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_JOBMASK", (SOLVER_JOBMASK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_WEAK", (SOLVER_WEAK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ESSENTIAL", (SOLVER_ESSENTIAL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_CLEANDEPS", (SOLVER_CLEANDEPS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FORCEBEST", (SOLVER_FORCEBEST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TARGETED", (SOLVER_TARGETED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_NOTBYUSER", (SOLVER_NOTBYUSER))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETEV", (SOLVER_SETEV))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETEVR", (SOLVER_SETEVR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETARCH", (SOLVER_SETARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETVENDOR", (SOLVER_SETVENDOR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETREPO", (SOLVER_SETREPO))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETNAME", (SOLVER_SETNAME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_NOAUTOSET", (SOLVER_NOAUTOSET))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SETMASK", (SOLVER_SETMASK))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Job_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Job_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Job_Sf_SwigStatic = {
    "Job",
    swig_Job_Sf_SwigStatic_methods,
    swig_Job_Sf_SwigStatic_attributes,
    swig_Job_Sf_SwigStatic_constants,
    swig_Job_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Job_bases[] = {0};
static const char *swig_Job_base_names[] = {0};
static swig_lua_class _wrap_class_Job = { "Job", "Job", &SWIGTYPE_p_Job,_proxy__wrap_new_Job, swig_delete_Job, swig_Job_methods, swig_Job_attributes, &swig_Job_Sf_SwigStatic, swig_Job_meta, swig_Job_bases, swig_Job_base_names };

static int _wrap_new_Pool(lua_State* L) {
  int SWIG_arg = 0;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Pool::Pool",0,0)
  result = (Pool *)new_Pool();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_setdisttype(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("Pool::setdisttype",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::setdisttype",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::setdisttype",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_setdisttype",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)Pool_setdisttype(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_debuglevel(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Pool::set_debuglevel",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_debuglevel",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::set_debuglevel",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_debuglevel",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  Pool_set_debuglevel(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_flag(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  int result;
  
  SWIG_check_num_args("Pool::set_flag",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_flag",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::set_flag",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::set_flag",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_flag",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  result = (int)Pool_set_flag(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_get_flag(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("Pool::get_flag",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::get_flag",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::get_flag",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_get_flag",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)Pool_get_flag(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_rootdir(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("Pool::set_rootdir",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_rootdir",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::set_rootdir",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_rootdir",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  Pool_set_rootdir(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_get_rootdir(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::get_rootdir",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::get_rootdir",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::get_rootdir",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_get_rootdir",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (char *)Pool_get_rootdir(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_clr_loadcallback(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  
  SWIG_check_num_args("Pool::clr_loadcallback",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::clr_loadcallback",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_clr_loadcallback",1,SWIGTYPE_p_Pool);
  }
  
  Pool_clr_loadcallback(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_loadcallback(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  lua_State *arg3 = 0 ;
  
  arg3 = L;
  SWIG_check_num_args("Pool::set_loadcallback",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_loadcallback",1,"Pool *");
  if(!lua_isfunction(L,2)) SWIG_fail_arg("Pool::set_loadcallback",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_loadcallback",1,SWIGTYPE_p_Pool);
  }
  
  {
    arg2 = 2; 
  }
  Pool_set_loadcallback(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_free(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  disown_helper result;
  
  SWIG_check_num_args("Pool::free",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::free",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_free",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_free(arg1);
  {
    SWIG_ConvertPtr(L, 1, (void **)&arg1, SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0);
    
    
    
    
    
    
    
    result = 0;
    lua_pushnumber(L, result); SWIG_arg++;
    
    
    
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_disown(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  disown_helper result;
  
  SWIG_check_num_args("Pool::disown",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::disown",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_disown",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_disown(arg1);
  {
    SWIG_ConvertPtr(L, 1, (void **)&arg1, SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0);
    
    
    
    
    
    
    
    result = 0;
    lua_pushnumber(L, result); SWIG_arg++;
    
    
    
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_appdata_set(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  AppObjectPtr arg2 = 0 ;
  
  SWIG_check_num_args("Pool::appdata",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::appdata",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_appdata_set",1,SWIGTYPE_p_Pool);
  }
  
  {
    arg2 = (void *)L;
  }
  Pool_appdata_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_appdata_get(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  AppObjectPtr result;
  
  SWIG_check_num_args("Pool::appdata",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::appdata",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_appdata_get",1,SWIGTYPE_p_Pool);
  }
  
  result = (AppObjectPtr)Pool_appdata_get(arg1);
  {
    get_stashed_lua_var(L, "appdata", result);
    SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_appdata_disown(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  
  SWIG_check_num_args("Pool::appdata_disown",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::appdata_disown",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_appdata_disown",1,SWIGTYPE_p_Pool);
  }
  
  Pool_appdata_disown(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_str2id(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  Id result;
  
  SWIG_check_num_args("Pool::str2id",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::str2id",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::str2id",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isboolean(L,3)) SWIG_fail_arg("Pool::str2id",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_str2id",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (lua_toboolean(L, 3)!=0);
  }
  result = (Id)Pool_str2id(arg1,(char const *)arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Dep(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Pool::Dep",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Dep",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::Dep",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isboolean(L,3)) SWIG_fail_arg("Pool::Dep",3,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Dep",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (lua_toboolean(L, 3)!=0);
  }
  result = (Dep *)Pool_Dep(arg1,(char const *)arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_id2str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::id2str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::id2str",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::id2str",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_id2str",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (char *)Pool_id2str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_dep2str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::dep2str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::dep2str",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::dep2str",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_dep2str",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (char *)Pool_dep2str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_rel2id(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  int arg4 ;
  bool arg5 = 1 ;
  Id result;
  
  SWIG_check_num_args("Pool::rel2id",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::rel2id",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::rel2id",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::rel2id",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Pool::rel2id",4,"int");
  if(lua_gettop(L)>=5 && !lua_isboolean(L,5)) SWIG_fail_arg("Pool::rel2id",5,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_rel2id",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (lua_toboolean(L, 5)!=0);
  }
  result = (Id)Pool_rel2id(arg1,arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_id2langid(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  bool arg4 = 1 ;
  Id result;
  
  SWIG_check_num_args("Pool::id2langid",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::id2langid",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::id2langid",2,"Id");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Pool::id2langid",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isboolean(L,4)) SWIG_fail_arg("Pool::id2langid",4,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_id2langid",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  if(lua_gettop(L)>=4){
    arg4 = (lua_toboolean(L, 4)!=0);
  }
  result = (Id)Pool_id2langid(arg1,arg2,(char const *)arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_setarch(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("Pool::setarch",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::setarch",1,"Pool *");
  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::setarch",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_setarch",1,SWIGTYPE_p_Pool);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (char *)lua_tostring(L, 2);
  }
  Pool_setarch(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_add_repo(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Pool::add_repo",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::add_repo",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::add_repo",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_add_repo",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (Repo *)Pool_add_repo(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_lookup_str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::lookup_str",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::lookup_str",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::lookup_str",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::lookup_str",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_lookup_str",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (char *)Pool_lookup_str(arg1,arg2,arg3);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_lookup_id(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id result;
  
  SWIG_check_num_args("Pool::lookup_id",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::lookup_id",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::lookup_id",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::lookup_id",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_lookup_id",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Id)Pool_lookup_id(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_lookup_num(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 = 0 ;
  unsigned long long result;
  
  SWIG_check_num_args("Pool::lookup_num",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::lookup_num",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::lookup_num",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::lookup_num",3,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Pool::lookup_num",4,"unsigned long long");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_lookup_num",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  if(lua_gettop(L)>=4){
    SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative");
    arg4 = (unsigned long long)lua_tonumber(L, 4);
  }
  result = (unsigned long long)Pool_lookup_num(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_lookup_void(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  bool result;
  
  SWIG_check_num_args("Pool::lookup_void",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::lookup_void",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::lookup_void",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::lookup_void",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_lookup_void",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (bool)Pool_lookup_void(arg1,arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_lookup_checksum(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("Pool::lookup_checksum",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::lookup_checksum",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::lookup_checksum",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::lookup_checksum",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_lookup_checksum",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Chksum *)Pool_lookup_checksum(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Dataiterator(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Pool::Dataiterator",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Dataiterator",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::Dataiterator",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Pool::Dataiterator",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Pool::Dataiterator",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Dataiterator",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (Dataiterator *)Pool_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Dataiterator_solvid(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  int arg5 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Pool::Dataiterator_solvid",3,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Dataiterator_solvid",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::Dataiterator_solvid",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::Dataiterator_solvid",3,"Id");
  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("Pool::Dataiterator_solvid",4,"char const *");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Pool::Dataiterator_solvid",5,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Dataiterator_solvid",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  if(lua_gettop(L)>=4){
    arg4 = (char *)lua_tostring(L, 4);
  }
  if(lua_gettop(L)>=5){
    arg5 = (int)lua_tonumber(L, 5);
  }
  result = (Dataiterator *)Pool_Dataiterator_solvid(arg1,arg2,arg3,(char const *)arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvid2str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::solvid2str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::solvid2str",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::solvid2str",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_solvid2str",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (char *)Pool_solvid2str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvidset2str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  char *result = 0 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::solvidset2str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::solvidset2str",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_solvidset2str",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        int v;
        int e = SWIG_AsVal_int(L, -1, &v);
        if (!SWIG_IsOK(e)) {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only " "integers");
          SWIG_fail;
        }
        queue_push(&arg2, v);
      }
      lua_pop(L, 1);
    }
  }
  
  result = (char *)Pool_solvidset2str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvableset2str(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  char *result = 0 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::solvableset2str",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::solvableset2str",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_solvableset2str",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        XSolvable * obj;
        int e = SWIG_ConvertPtr(L, -1, (void **)&obj, SWIGTYPE_p_XSolvable, 0 | 0);
        if (!SWIG_IsOK(e))
        {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only ""XSolvable *");
          SWIG_fail;
        }
        queue_push(&arg2, obj->id);
      }
      lua_pop(L, 1);
    }
  }
  
  result = (char *)Pool_solvableset2str(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_addfileprovides(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  
  SWIG_check_num_args("Pool::addfileprovides",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::addfileprovides",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_addfileprovides",1,SWIGTYPE_p_Pool);
  }
  
  Pool_addfileprovides(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_addfileprovides_queue(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Pool::addfileprovides_queue",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::addfileprovides_queue",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_addfileprovides_queue",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_addfileprovides_queue(arg1);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_createwhatprovides(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  
  SWIG_check_num_args("Pool::createwhatprovides",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::createwhatprovides",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_createwhatprovides",1,SWIGTYPE_p_Pool);
  }
  
  Pool_createwhatprovides(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_id2solvable(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Pool::id2solvable",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::id2solvable",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::id2solvable",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_id2solvable",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (XSolvable *)Pool_id2solvable(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvables_get(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::solvables",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_solvables_get",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_solvable_iterator *)Pool_solvables_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_solvables_iter(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool::solvables_iter",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::solvables_iter",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_solvables_iter",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_solvable_iterator *)Pool_solvables_iter(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_id2repo(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Pool::id2repo",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::id2repo",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::id2repo",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_id2repo",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Repo *)Pool_id2repo(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_repos_get(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool::repos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::repos",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_repos_get",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_repo_iterator *)Pool_repos_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_repo_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_repos_iter(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  
  SWIG_check_num_args("Pool::repos_iter",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::repos_iter",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_repos_iter",1,SWIGTYPE_p_Pool);
  }
  
  result = (Pool_repo_iterator *)Pool_repos_iter(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool_repo_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_installed_set(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Repo *arg2 = 0 ;
  
  SWIG_check_num_args("Pool::installed",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::installed",1,"Pool *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Pool::installed",2,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_installed_set",1,SWIGTYPE_p_Pool);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Repo,SWIG_POINTER_DISOWN))){
    SWIG_fail_ptr("Pool_installed_set",2,SWIGTYPE_p_Repo);
  }
  
  Pool_installed_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_installed_get(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Pool::installed",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::installed",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_installed_get",1,SWIGTYPE_p_Pool);
  }
  
  result = (Repo *)Pool_installed_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_errstr_get(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Pool::errstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::errstr",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_errstr_get",1,SWIGTYPE_p_Pool);
  }
  
  result = (char *)Pool_errstr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_matchprovidingids(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Queue result;
  
  SWIG_check_num_args("Pool::matchprovidingids",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::matchprovidingids",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::matchprovidingids",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::matchprovidingids",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_matchprovidingids",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  result = Pool_matchprovidingids(arg1,(char const *)arg2,arg3);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Job(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  Job *result = 0 ;
  
  SWIG_check_num_args("Pool::Job",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Job",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::Job",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::Job",3,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Job",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  result = (Job *)Pool_Job(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Job,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_whatprovides(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  Queue result;
  
  SWIG_check_num_args("Pool::whatprovides",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::whatprovides",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_whatprovides",1,SWIGTYPE_p_Pool);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Pool_whatprovides", 2, "DepId")
  arg2 = val2;
  result = Pool_whatprovides(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_best_solvables(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  int arg3 = 0 ;
  Queue result;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::best_solvables",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::best_solvables",1,"Pool *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("Pool::best_solvables",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_best_solvables",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        XSolvable * obj;
        int e = SWIG_ConvertPtr(L, -1, (void **)&obj, SWIGTYPE_p_XSolvable, 0 | 0);
        if (!SWIG_IsOK(e))
        {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only ""XSolvable *");
          SWIG_fail;
        }
        queue_push(&arg2, obj->id);
      }
      lua_pop(L, 1);
    }
  }
  
  if(lua_gettop(L)>=3){
    arg3 = (int)lua_tonumber(L, 3);
  }
  result = Pool_best_solvables(arg1,arg2,arg3);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_towhatprovides(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  Id result;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::towhatprovides",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::towhatprovides",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_towhatprovides",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        int v;
        int e = SWIG_AsVal_int(L, -1, &v);
        if (!SWIG_IsOK(e)) {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only " "integers");
          SWIG_fail;
        }
        queue_push(&arg2, v);
      }
      lua_pop(L, 1);
    }
  }
  
  result = (Id)Pool_towhatprovides(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_namespaceproviders(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  DepId arg2 ;
  DepId arg3 ;
  bool arg4 = 1 ;
  int val2 ;
  int ecode2 ;
  int val3 ;
  int ecode3 ;
  
  SWIG_check_num_args("Pool::set_namespaceproviders",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_namespaceproviders",1,"Pool *");
  if(lua_gettop(L)>=4 && !lua_isboolean(L,4)) SWIG_fail_arg("Pool::set_namespaceproviders",4,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_namespaceproviders",1,SWIGTYPE_p_Pool);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Pool_set_namespaceproviders", 2, "DepId")
  arg2 = val2;
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("Pool_set_namespaceproviders", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (lua_toboolean(L, 4)!=0);
  }
  Pool_set_namespaceproviders(arg1,arg2,arg3,arg4);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_flush_namespaceproviders(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  DepId arg2 ;
  DepId arg3 ;
  int val2 ;
  int ecode2 ;
  int val3 ;
  int ecode3 ;
  
  SWIG_check_num_args("Pool::flush_namespaceproviders",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::flush_namespaceproviders",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_flush_namespaceproviders",1,SWIGTYPE_p_Pool);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Pool_flush_namespaceproviders", 2, "DepId")
  arg2 = val2;
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("Pool_flush_namespaceproviders", 3, "DepId")
  arg3 = val3;
  Pool_flush_namespaceproviders(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_whatcontainsdep(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  int val3 ;
  int ecode3 ;
  Queue result;
  
  SWIG_check_num_args("Pool::whatcontainsdep",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::whatcontainsdep",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::whatcontainsdep",2,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Pool::whatcontainsdep",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_whatcontainsdep",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("Pool_whatcontainsdep", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (Id)lua_tonumber(L, 4);
  }
  result = Pool_whatcontainsdep(arg1,arg2,arg3,arg4);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_whatmatchesdep(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  int val3 ;
  int ecode3 ;
  Queue result;
  
  SWIG_check_num_args("Pool::whatmatchesdep",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::whatmatchesdep",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::whatmatchesdep",2,"Id");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Pool::whatmatchesdep",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_whatmatchesdep",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  ecode3 = SWIG_AsValDepId(L, 3, &val3);
  if (!SWIG_IsOK(ecode3)) SWIG_fail_arg("Pool_whatmatchesdep", 3, "DepId")
  arg3 = val3;
  if(lua_gettop(L)>=4){
    arg4 = (Id)lua_tonumber(L, 4);
  }
  result = Pool_whatmatchesdep(arg1,arg2,arg3,arg4);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_whatmatchessolvable(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Id arg2 ;
  XSolvable *arg3 = 0 ;
  Id arg4 = -1 ;
  Queue result;
  
  SWIG_check_num_args("Pool::whatmatchessolvable",3,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::whatmatchessolvable",1,"Pool *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Pool::whatmatchessolvable",2,"Id");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("Pool::whatmatchessolvable",3,"XSolvable *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Pool::whatmatchessolvable",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_whatmatchessolvable",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Pool_whatmatchessolvable",3,SWIGTYPE_p_XSolvable);
  }
  
  if(lua_gettop(L)>=4){
    arg4 = (Id)lua_tonumber(L, 4);
  }
  result = Pool_whatmatchessolvable(arg1,arg2,arg3,arg4);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_isknownarch(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  DepId arg2 ;
  int val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("Pool::isknownarch",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::isknownarch",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_isknownarch",1,SWIGTYPE_p_Pool);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Pool_isknownarch", 2, "DepId")
  arg2 = val2;
  result = (bool)Pool_isknownarch(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Solver(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Pool::Solver",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Solver",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Solver",1,SWIGTYPE_p_Pool);
  }
  
  result = (Solver *)Pool_Solver(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Selection(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::Selection",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Selection",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Selection",1,SWIGTYPE_p_Pool);
  }
  
  result = (Selection *)Pool_Selection(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_Selection_all(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::Selection_all",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::Selection_all",1,"Pool *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Pool::Selection_all",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_Selection_all",1,SWIGTYPE_p_Pool);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)Pool_Selection_all(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_select(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::select",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::select",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::select",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::select",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_select",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  result = (Selection *)Pool_select(arg1,(char const *)arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_matchdeps(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::matchdeps",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::matchdeps",1,"Pool *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Pool::matchdeps",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::matchdeps",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Pool::matchdeps",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Pool::matchdeps",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_matchdeps",1,SWIGTYPE_p_Pool);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  result = (Selection *)Pool_matchdeps(arg1,(char const *)arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_matchdepid(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  DepId arg2 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  int val2 ;
  int ecode2 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::matchdepid",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::matchdepid",1,"Pool *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::matchdepid",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Pool::matchdepid",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Pool::matchdepid",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_matchdepid",1,SWIGTYPE_p_Pool);
  }
  
  ecode2 = SWIG_AsValDepId(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Pool_matchdepid", 2, "DepId")
  arg2 = val2;
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  result = (Selection *)Pool_matchdepid(arg1,arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_matchsolvable(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Pool::matchsolvable",4,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::matchsolvable",1,"Pool *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Pool::matchsolvable",2,"XSolvable *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Pool::matchsolvable",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Pool::matchsolvable",4,"Id");
  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("Pool::matchsolvable",5,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_matchsolvable",1,SWIGTYPE_p_Pool);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Pool_matchsolvable",2,SWIGTYPE_p_XSolvable);
  }
  
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (Id)lua_tonumber(L, 5);
  }
  result = (Selection *)Pool_matchsolvable(arg1,arg2,arg3,arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_get_considered_list(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Pool::get_considered_list",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::get_considered_list",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_get_considered_list",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_get_considered_list(arg1);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_get_disabled_list(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Pool::get_disabled_list",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::get_disabled_list",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_get_disabled_list",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_get_disabled_list(arg1);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_considered_list(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::set_considered_list",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_considered_list",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_considered_list",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        int v;
        int e = SWIG_AsVal_int(L, -1, &v);
        if (!SWIG_IsOK(e)) {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only " "integers");
          SWIG_fail;
        }
        queue_push(&arg2, v);
      }
      lua_pop(L, 1);
    }
  }
  
  Pool_set_considered_list(arg1,arg2);
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_set_disabled_list(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::set_disabled_list",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::set_disabled_list",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_set_disabled_list",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        int v;
        int e = SWIG_AsVal_int(L, -1, &v);
        if (!SWIG_IsOK(e)) {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only " "integers");
          SWIG_fail;
        }
        queue_push(&arg2, v);
      }
      lua_pop(L, 1);
    }
  }
  
  Pool_set_disabled_list(arg1,arg2);
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_setpooljobs(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue arg2 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Pool::setpooljobs",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::setpooljobs",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_setpooljobs",1,SWIGTYPE_p_Pool);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        Job * obj;
        int e = SWIG_ConvertPtr(L, -1, (void **)&obj, SWIGTYPE_p_Job, 0 | 0);
        if (!SWIG_IsOK(e))
        {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only ""Job *");
          SWIG_fail;
        }
        queue_push2(&arg2, obj->how, obj->what);
      }
      lua_pop(L, 1);
    }
  }
  
  Pool_setpooljobs(arg1,arg2);
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Pool_getpooljobs(lua_State* L) {
  int SWIG_arg = 0;
  Pool *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Pool::getpooljobs",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Pool::getpooljobs",1,"Pool *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Pool,0))){
    SWIG_fail_ptr("Pool_getpooljobs",1,SWIGTYPE_p_Pool);
  }
  
  result = Pool_getpooljobs(arg1);
  
  int i;
  int cnt = (&result)->count / 2;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 2)
  {
    Id id = *idp;
#define result resultx
    Job * result = new_Job(arg1, id, idp[1]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Job,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Pool(void *obj) {
Pool *arg1 = (Pool *) obj;
delete_Pool(arg1);
}
static int _proxy__wrap_new_Pool(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Pool);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Pool_attributes[] = {
    { "appdata", _wrap_Pool_appdata_get, _wrap_Pool_appdata_set },
    { "solvables", _wrap_Pool_solvables_get, SWIG_Lua_set_immutable },
    { "repos", _wrap_Pool_repos_get, SWIG_Lua_set_immutable },
    { "installed", _wrap_Pool_installed_get, _wrap_Pool_installed_set },
    { "errstr", _wrap_Pool_errstr_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Pool_methods[]= {
    { "setdisttype", _wrap_Pool_setdisttype},
    { "set_debuglevel", _wrap_Pool_set_debuglevel},
    { "set_flag", _wrap_Pool_set_flag},
    { "get_flag", _wrap_Pool_get_flag},
    { "set_rootdir", _wrap_Pool_set_rootdir},
    { "get_rootdir", _wrap_Pool_get_rootdir},
    { "clr_loadcallback", _wrap_Pool_clr_loadcallback},
    { "set_loadcallback", _wrap_Pool_set_loadcallback},
    { "free", _wrap_Pool_free},
    { "disown", _wrap_Pool_disown},
    { "appdata_disown", _wrap_Pool_appdata_disown},
    { "str2id", _wrap_Pool_str2id},
    { "Dep", _wrap_Pool_Dep},
    { "id2str", _wrap_Pool_id2str},
    { "dep2str", _wrap_Pool_dep2str},
    { "rel2id", _wrap_Pool_rel2id},
    { "id2langid", _wrap_Pool_id2langid},
    { "setarch", _wrap_Pool_setarch},
    { "add_repo", _wrap_Pool_add_repo},
    { "lookup_str", _wrap_Pool_lookup_str},
    { "lookup_id", _wrap_Pool_lookup_id},
    { "lookup_num", _wrap_Pool_lookup_num},
    { "lookup_void", _wrap_Pool_lookup_void},
    { "lookup_checksum", _wrap_Pool_lookup_checksum},
    { "Dataiterator", _wrap_Pool_Dataiterator},
    { "Dataiterator_solvid", _wrap_Pool_Dataiterator_solvid},
    { "solvid2str", _wrap_Pool_solvid2str},
    { "solvidset2str", _wrap_Pool_solvidset2str},
    { "solvableset2str", _wrap_Pool_solvableset2str},
    { "addfileprovides", _wrap_Pool_addfileprovides},
    { "addfileprovides_queue", _wrap_Pool_addfileprovides_queue},
    { "createwhatprovides", _wrap_Pool_createwhatprovides},
    { "id2solvable", _wrap_Pool_id2solvable},
    { "solvables_iter", _wrap_Pool_solvables_iter},
    { "id2repo", _wrap_Pool_id2repo},
    { "repos_iter", _wrap_Pool_repos_iter},
    { "matchprovidingids", _wrap_Pool_matchprovidingids},
    { "Job", _wrap_Pool_Job},
    { "whatprovides", _wrap_Pool_whatprovides},
    { "best_solvables", _wrap_Pool_best_solvables},
    { "towhatprovides", _wrap_Pool_towhatprovides},
    { "set_namespaceproviders", _wrap_Pool_set_namespaceproviders},
    { "flush_namespaceproviders", _wrap_Pool_flush_namespaceproviders},
    { "whatcontainsdep", _wrap_Pool_whatcontainsdep},
    { "whatmatchesdep", _wrap_Pool_whatmatchesdep},
    { "whatmatchessolvable", _wrap_Pool_whatmatchessolvable},
    { "isknownarch", _wrap_Pool_isknownarch},
    { "Solver", _wrap_Pool_Solver},
    { "Selection", _wrap_Pool_Selection},
    { "Selection_all", _wrap_Pool_Selection_all},
    { "select", _wrap_Pool_select},
    { "matchdeps", _wrap_Pool_matchdeps},
    { "matchdepid", _wrap_Pool_matchdepid},
    { "matchsolvable", _wrap_Pool_matchsolvable},
    { "get_considered_list", _wrap_Pool_get_considered_list},
    { "get_disabled_list", _wrap_Pool_get_disabled_list},
    { "set_considered_list", _wrap_Pool_set_considered_list},
    { "set_disabled_list", _wrap_Pool_set_disabled_list},
    { "setpooljobs", _wrap_Pool_setpooljobs},
    { "getpooljobs", _wrap_Pool_getpooljobs},
    {0,0}
};
static swig_lua_method swig_Pool_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Pool_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Pool_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_PROMOTEEPOCH", (POOL_FLAG_PROMOTEEPOCH))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_FORBIDSELFCONFLICTS", (POOL_FLAG_FORBIDSELFCONFLICTS))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_OBSOLETEUSESPROVIDES", (POOL_FLAG_OBSOLETEUSESPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES", (POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_OBSOLETEUSESCOLORS", (POOL_FLAG_OBSOLETEUSESCOLORS))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS", (POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_NOINSTALLEDOBSOLETES", (POOL_FLAG_NOINSTALLEDOBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_HAVEDISTEPOCH", (POOL_FLAG_HAVEDISTEPOCH))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_NOOBSOLETESMULTIVERSION", (POOL_FLAG_NOOBSOLETESMULTIVERSION))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_ADDFILEPROVIDESFILTERED", (POOL_FLAG_ADDFILEPROVIDESFILTERED))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_NOWHATPROVIDESAUX", (POOL_FLAG_NOWHATPROVIDESAUX))},
    {SWIG_LUA_CONSTTAB_INT("POOL_FLAG_WHATPROVIDESWITHDISABLED", (POOL_FLAG_WHATPROVIDESWITHDISABLED))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_RPM", (DISTTYPE_RPM))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_DEB", (DISTTYPE_DEB))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_ARCH", (DISTTYPE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_HAIKU", (DISTTYPE_HAIKU))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_CONDA", (DISTTYPE_CONDA))},
    {SWIG_LUA_CONSTTAB_INT("DISTTYPE_APK", (DISTTYPE_APK))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Pool_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Pool_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Pool_Sf_SwigStatic = {
    "Pool",
    swig_Pool_Sf_SwigStatic_methods,
    swig_Pool_Sf_SwigStatic_attributes,
    swig_Pool_Sf_SwigStatic_constants,
    swig_Pool_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Pool_bases[] = {0};
static const char *swig_Pool_base_names[] = {0};
static swig_lua_class _wrap_class_Pool = { "Pool", "Pool", &SWIGTYPE_p_Pool,_proxy__wrap_new_Pool, swig_delete_Pool, swig_Pool_methods, swig_Pool_attributes, &swig_Pool_Sf_SwigStatic, swig_Pool_meta, swig_Pool_bases, swig_Pool_base_names };

static int _wrap_Repo_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Repo::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::pool",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_pool_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_name_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Repo::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::name",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_name_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (char *)(char *) ((arg1)->name);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_priority_set(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Repo::priority",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::priority",1,"Repo *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Repo::priority",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_priority_set",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  if (arg1) (arg1)->priority = arg2;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_priority_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Repo::priority",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::priority",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_priority_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (int) ((arg1)->priority);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_subpriority_set(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Repo::subpriority",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::subpriority",1,"Repo *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Repo::subpriority",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_subpriority_set",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  if (arg1) (arg1)->subpriority = arg2;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_subpriority_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Repo::subpriority",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::subpriority",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_subpriority_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (int) ((arg1)->subpriority);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_nsolvables_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Repo::nsolvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::nsolvables",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_nsolvables_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (int)(int) ((arg1)->nsolvables);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_free(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  bool arg2 = 0 ;
  
  SWIG_check_num_args("Repo::free",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::free",1,"Repo *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Repo::free",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_free",1,SWIGTYPE_p_Repo);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  Repo_free(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_empty(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  bool arg2 = 0 ;
  
  SWIG_check_num_args("Repo::empty",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::empty",1,"Repo *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Repo::empty",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_empty",1,SWIGTYPE_p_Repo);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  Repo_empty(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_isempty(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("Repo::isempty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::isempty",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_isempty",1,SWIGTYPE_p_Repo);
  }
  
  result = (bool)Repo_isempty(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_appdata_set(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  AppObjectPtr arg2 = 0 ;
  
  SWIG_check_num_args("Repo::appdata",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::appdata",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_appdata_set",1,SWIGTYPE_p_Repo);
  }
  
  {
    arg2 = (void *)L;
  }
  Repo_appdata_set(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_appdata_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  AppObjectPtr result;
  
  SWIG_check_num_args("Repo::appdata",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::appdata",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_appdata_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (AppObjectPtr)Repo_appdata_get(arg1);
  {
    get_stashed_lua_var(L, "appdata", result);
    SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_add_solv__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  bool result;
  
  SWIG_check_num_args("Repo::add_solv",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::add_solv",1,"Repo *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Repo::add_solv",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("Repo::add_solv",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_add_solv",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (int)lua_tonumber(L, 3);
  }
  result = (bool)Repo_add_solv__SWIG_0(arg1,(char const *)arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_add_solv__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("Repo::add_solv",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::add_solv",1,"Repo *");
  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("Repo::add_solv",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_add_solv",1,SWIGTYPE_p_Repo);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Repo_add_solv", 2, "FILE *");
  arg2 = val2;
  if(lua_gettop(L)>=3){
    arg3 = (int)lua_tonumber(L, 3);
  }
  result = (bool)Repo_add_solv__SWIG_1(arg1,arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_add_solv(lua_State* L) {
  int argc;
  int argv[4]={
    1,2,3,4
  };
  
  argc = lua_gettop(L);
  if ((argc >= 2) && (argc <= 3)) {
    int _v = 0;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Repo, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        int res = SWIG_AsValSolvFpPtr(L, argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_Repo_add_solv__SWIG_1(L);
        }
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Repo_add_solv__SWIG_1(L);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v = 0;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Repo, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_Repo_add_solv__SWIG_0(L);
        }
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          return _wrap_Repo_add_solv__SWIG_0(L);
        }
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Repo_add_solv'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Repo::add_solv(char const *,int)\n"
    "    Repo::add_solv(FILE *,int)\n");
  lua_error(L);return 0;
}


static int _wrap_Repo_add_solvable(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Repo::add_solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::add_solvable",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_add_solvable",1,SWIGTYPE_p_Repo);
  }
  
  result = (XSolvable *)Repo_add_solvable(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_internalize(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  
  SWIG_check_num_args("Repo::internalize",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::internalize",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_internalize",1,SWIGTYPE_p_Repo);
  }
  
  Repo_internalize(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_write(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("Repo::write",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::write",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_write",1,SWIGTYPE_p_Repo);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Repo_write", 2, "FILE *");
  arg2 = val2;
  result = (bool)Repo_write(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_write_first_repodata(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  bool result;
  
  SWIG_check_num_args("Repo::write_first_repodata",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::write_first_repodata",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_write_first_repodata",1,SWIGTYPE_p_Repo);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Repo_write_first_repodata", 2, "FILE *");
  arg2 = val2;
  result = (bool)Repo_write_first_repodata(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_Dataiterator(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Repo::Dataiterator",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::Dataiterator",1,"Repo *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Repo::Dataiterator",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Repo::Dataiterator",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Repo::Dataiterator",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_Dataiterator",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (Dataiterator *)Repo_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_Dataiterator_meta(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  Dataiterator *result = 0 ;
  
  SWIG_check_num_args("Repo::Dataiterator_meta",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::Dataiterator_meta",1,"Repo *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Repo::Dataiterator_meta",2,"Id");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Repo::Dataiterator_meta",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("Repo::Dataiterator_meta",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_Dataiterator_meta",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (Dataiterator *)Repo_Dataiterator_meta(arg1,arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dataiterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Repo::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::id",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_id_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (Id)Repo_id_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_solvables_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Repo::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::solvables",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_solvables_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (Repo_solvable_iterator *)Repo_solvables_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_meta_get(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Datapos *result = 0 ;
  
  SWIG_check_num_args("Repo::meta",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::meta",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_meta_get",1,SWIGTYPE_p_Repo);
  }
  
  result = (Datapos *)Repo_meta_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Datapos,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_solvables_iter(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  
  SWIG_check_num_args("Repo::solvables_iter",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::solvables_iter",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_solvables_iter",1,SWIGTYPE_p_Repo);
  }
  
  result = (Repo_solvable_iterator *)Repo_solvables_iter(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo_solvable_iterator,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_add_repodata(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  XRepodata *result = 0 ;
  
  SWIG_check_num_args("Repo::add_repodata",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::add_repodata",1,"Repo *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Repo::add_repodata",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_add_repodata",1,SWIGTYPE_p_Repo);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (XRepodata *)Repo_add_repodata(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRepodata,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_create_stubs(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  
  SWIG_check_num_args("Repo::create_stubs",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::create_stubs",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_create_stubs",1,SWIGTYPE_p_Repo);
  }
  
  Repo_create_stubs(arg1);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_iscontiguous(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("Repo::iscontiguous",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::iscontiguous",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_iscontiguous",1,SWIGTYPE_p_Repo);
  }
  
  result = (bool)Repo_iscontiguous(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_first_repodata(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  XRepodata *result = 0 ;
  
  SWIG_check_num_args("Repo::first_repodata",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::first_repodata",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_first_repodata",1,SWIGTYPE_p_Repo);
  }
  
  result = (XRepodata *)Repo_first_repodata(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRepodata,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_Selection(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  Selection *result = 0 ;
  
  SWIG_check_num_args("Repo::Selection",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::Selection",1,"Repo *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Repo::Selection",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_Selection",1,SWIGTYPE_p_Repo);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = (Selection *)Repo_Selection(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Selection,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_createshadow(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  Repo *result = 0 ;
  
  SWIG_check_num_args("Repo::createshadow",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::createshadow",1,"Repo *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Repo::createshadow",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_createshadow",1,SWIGTYPE_p_Repo);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (Repo *)Repo_createshadow(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Repo,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_moveshadow(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Queue arg2 ;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Repo::moveshadow",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::moveshadow",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_moveshadow",1,SWIGTYPE_p_Repo);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        int v;
        int e = SWIG_AsVal_int(L, -1, &v);
        if (!SWIG_IsOK(e)) {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only " "integers");
          SWIG_fail;
        }
        queue_push(&arg2, v);
      }
      lua_pop(L, 1);
    }
  }
  
  Repo_moveshadow(arg1,arg2);
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Repo___eq(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Repo *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Repo::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::__eq__",1,"Repo *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Repo::__eq__",2,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo___eq",1,SWIGTYPE_p_Repo);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo___eq",2,SWIGTYPE_p_Repo);
  }
  
  result = (bool)Repo___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo___ne(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  Repo *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Repo::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::__ne__",1,"Repo *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Repo::__ne__",2,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo___ne",1,SWIGTYPE_p_Repo);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo___ne",2,SWIGTYPE_p_Repo);
  }
  
  result = (bool)Repo___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Repo::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::__str__",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo___tostring",1,SWIGTYPE_p_Repo);
  }
  
  result = (char *)Repo___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Repo_repr(lua_State* L) {
  int SWIG_arg = 0;
  Repo *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Repo::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Repo::__repr__",1,"Repo *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Repo,0))){
    SWIG_fail_ptr("Repo_repr",1,SWIGTYPE_p_Repo);
  }
  
  result = (char *)Repo___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static swig_lua_attribute swig_Repo_attributes[] = {
    { "pool", _wrap_Repo_pool_get, SWIG_Lua_set_immutable },
    { "name", _wrap_Repo_name_get, SWIG_Lua_set_immutable },
    { "priority", _wrap_Repo_priority_get, _wrap_Repo_priority_set },
    { "subpriority", _wrap_Repo_subpriority_get, _wrap_Repo_subpriority_set },
    { "nsolvables", _wrap_Repo_nsolvables_get, SWIG_Lua_set_immutable },
    { "appdata", _wrap_Repo_appdata_get, _wrap_Repo_appdata_set },
    { "id", _wrap_Repo_id_get, SWIG_Lua_set_immutable },
    { "solvables", _wrap_Repo_solvables_get, SWIG_Lua_set_immutable },
    { "meta", _wrap_Repo_meta_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Repo_methods[]= {
    { "free", _wrap_Repo_free},
    { "empty", _wrap_Repo_empty},
    { "isempty", _wrap_Repo_isempty},
    { "add_solv", _wrap_Repo_add_solv},
    { "add_solvable", _wrap_Repo_add_solvable},
    { "internalize", _wrap_Repo_internalize},
    { "write", _wrap_Repo_write},
    { "write_first_repodata", _wrap_Repo_write_first_repodata},
    { "Dataiterator", _wrap_Repo_Dataiterator},
    { "Dataiterator_meta", _wrap_Repo_Dataiterator_meta},
    { "solvables_iter", _wrap_Repo_solvables_iter},
    { "add_repodata", _wrap_Repo_add_repodata},
    { "create_stubs", _wrap_Repo_create_stubs},
    { "iscontiguous", _wrap_Repo_iscontiguous},
    { "first_repodata", _wrap_Repo_first_repodata},
    { "Selection", _wrap_Repo_Selection},
    { "createshadow", _wrap_Repo_createshadow},
    { "moveshadow", _wrap_Repo_moveshadow},
    { "__eq", _wrap_Repo___eq},
    { "__ne", _wrap_Repo___ne},
    { "__tostring", _wrap_Repo___tostring},
    { "repr", _wrap_Repo_repr},
    {0,0}
};
static swig_lua_method swig_Repo_meta[] = {
    { "__eq", _wrap_Repo___eq},
    { "__ne", _wrap_Repo___ne},
    { "__tostring", _wrap_Repo___tostring},
    {0,0}
};

static swig_lua_attribute swig_Repo_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Repo_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("REPO_REUSE_REPODATA", (REPO_REUSE_REPODATA))},
    {SWIG_LUA_CONSTTAB_INT("REPO_NO_INTERNALIZE", (REPO_NO_INTERNALIZE))},
    {SWIG_LUA_CONSTTAB_INT("REPO_LOCALPOOL", (REPO_LOCALPOOL))},
    {SWIG_LUA_CONSTTAB_INT("REPO_USE_LOADING", (REPO_USE_LOADING))},
    {SWIG_LUA_CONSTTAB_INT("REPO_EXTEND_SOLVABLES", (REPO_EXTEND_SOLVABLES))},
    {SWIG_LUA_CONSTTAB_INT("REPO_USE_ROOTDIR", (REPO_USE_ROOTDIR))},
    {SWIG_LUA_CONSTTAB_INT("REPO_NO_LOCATION", (REPO_NO_LOCATION))},
    {SWIG_LUA_CONSTTAB_INT("SOLV_ADD_NO_STUBS", (SOLV_ADD_NO_STUBS))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Repo_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Repo_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Repo_Sf_SwigStatic = {
    "Repo",
    swig_Repo_Sf_SwigStatic_methods,
    swig_Repo_Sf_SwigStatic_attributes,
    swig_Repo_Sf_SwigStatic_constants,
    swig_Repo_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Repo_bases[] = {0};
static const char *swig_Repo_base_names[] = {0};
static swig_lua_class _wrap_class_Repo = { "Repo", "Repo", &SWIGTYPE_p_Repo,0,0, swig_Repo_methods, swig_Repo_attributes, &swig_Repo_Sf_SwigStatic, swig_Repo_meta, swig_Repo_bases, swig_Repo_base_names };

static int _wrap_Decision_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Decision::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::solv",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_solv_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_p_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Decision::p",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::p",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_p_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (Id)(Id) ((arg1)->p);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_reason_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Decision::reason",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::reason",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_reason_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (int)(int) ((arg1)->reason);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_infoid_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Decision::infoid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::infoid",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_infoid_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (Id)(Id) ((arg1)->infoid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Decision(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  int arg3 ;
  Id arg4 ;
  Decision *result = 0 ;
  
  SWIG_check_num_args("Decision::Decision",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::Decision",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Decision::Decision",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Decision::Decision",3,"int");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Decision::Decision",4,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_Decision",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  result = (Decision *)new_Decision(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_rule_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  XRule *result = 0 ;
  
  SWIG_check_num_args("Decision::rule",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::rule",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_rule_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (XRule *)Decision_rule_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_solvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Decision::solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::solvable",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_solvable_get",1,SWIGTYPE_p_Decision);
  }
  
  result = (XSolvable *)Decision_solvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_info(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  Ruleinfo *result = 0 ;
  
  SWIG_check_num_args("Decision::info",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::info",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_info",1,SWIGTYPE_p_Decision);
  }
  
  result = (Ruleinfo *)Decision_info(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_allinfos(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Decision::allinfos",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::allinfos",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_allinfos",1,SWIGTYPE_p_Decision);
  }
  
  result = Decision_allinfos(arg1);
  
  int i;
  int cnt = (&result)->count / 4;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 4)
  {
    Id id = *idp;
#define result resultx
    Ruleinfo * result = new_Ruleinfo(arg1->solv, arg1->infoid, id, idp[1], idp[2], idp[3]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision_reasonstr(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  bool arg2 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Decision::reasonstr",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::reasonstr",1,"Decision *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Decision::reasonstr",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision_reasonstr",1,SWIGTYPE_p_Decision);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  result = (char *)Decision_reasonstr(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decision___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Decision *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Decision::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decision::__str__",1,"Decision *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decision,0))){
    SWIG_fail_ptr("Decision___tostring",1,SWIGTYPE_p_Decision);
  }
  
  result = (char *)Decision___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Decision(void *obj) {
Decision *arg1 = (Decision *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Decision(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Decision);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Decision_attributes[] = {
    { "solv", _wrap_Decision_solv_get, SWIG_Lua_set_immutable },
    { "p", _wrap_Decision_p_get, SWIG_Lua_set_immutable },
    { "reason", _wrap_Decision_reason_get, SWIG_Lua_set_immutable },
    { "infoid", _wrap_Decision_infoid_get, SWIG_Lua_set_immutable },
    { "rule", _wrap_Decision_rule_get, SWIG_Lua_set_immutable },
    { "solvable", _wrap_Decision_solvable_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Decision_methods[]= {
    { "info", _wrap_Decision_info},
    { "allinfos", _wrap_Decision_allinfos},
    { "reasonstr", _wrap_Decision_reasonstr},
    { "__tostring", _wrap_Decision___tostring},
    {0,0}
};
static swig_lua_method swig_Decision_meta[] = {
    { "__tostring", _wrap_Decision___tostring},
    {0,0}
};

static swig_lua_attribute swig_Decision_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Decision_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Decision_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Decision_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Decision_Sf_SwigStatic = {
    "Decision",
    swig_Decision_Sf_SwigStatic_methods,
    swig_Decision_Sf_SwigStatic_attributes,
    swig_Decision_Sf_SwigStatic_constants,
    swig_Decision_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Decision_bases[] = {0};
static const char *swig_Decision_base_names[] = {0};
static swig_lua_class _wrap_class_Decision = { "Decision", "Decision", &SWIGTYPE_p_Decision,_proxy__wrap_new_Decision, swig_delete_Decision, swig_Decision_methods, swig_Decision_attributes, &swig_Decision_Sf_SwigStatic, swig_Decision_meta, swig_Decision_bases, swig_Decision_base_names };

static int _wrap_Decisionset_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Decisionset::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::solv",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_solv_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_p_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Decisionset::p",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::p",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_p_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Id)(Id) ((arg1)->p);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_reason_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Decisionset::reason",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::reason",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_reason_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (int)(int) ((arg1)->reason);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_infoid_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Decisionset::infoid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::infoid",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_infoid_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Id)(Id) ((arg1)->infoid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_bits_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Decisionset::bits",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::bits",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_bits_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (int)(int) ((arg1)->bits);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_type_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Decisionset::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::type",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_type_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (int)(int) ((arg1)->type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_dep_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Decisionset::dep_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::dep_id",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_dep_id_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Id)(Id) ((arg1)->dep_id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Decisionset(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Decisionset *result = 0 ;
  
  SWIG_check_num_args("Decisionset::Decisionset",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::Decisionset",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_Decisionset",1,SWIGTYPE_p_Solver);
  }
  
  result = (Decisionset *)new_Decisionset(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decisionset,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_info(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Ruleinfo *result = 0 ;
  
  SWIG_check_num_args("Decisionset::info",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::info",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_info",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Ruleinfo *)Decisionset_info(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Ruleinfo,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_dep_get(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Decisionset::dep",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::dep",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_dep_get",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (Dep *)Decisionset_dep_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_solvables(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Decisionset::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::solvables",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_solvables",1,SWIGTYPE_p_Decisionset);
  }
  
  result = Decisionset_solvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->solv->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_decisions(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Decisionset::decisions",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::decisions",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_decisions",1,SWIGTYPE_p_Decisionset);
  }
  
  result = Decisionset_decisions(arg1);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Decision * result = new_Decision(arg1->solv, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset_reasonstr(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  bool arg2 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Decisionset::reasonstr",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::reasonstr",1,"Decisionset *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Decisionset::reasonstr",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset_reasonstr",1,SWIGTYPE_p_Decisionset);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  result = (char *)Decisionset_reasonstr(arg1,arg2);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Decisionset___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Decisionset *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Decisionset::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Decisionset::__str__",1,"Decisionset *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Decisionset,0))){
    SWIG_fail_ptr("Decisionset___tostring",1,SWIGTYPE_p_Decisionset);
  }
  
  result = (char *)Decisionset___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Decisionset(void *obj) {
Decisionset *arg1 = (Decisionset *) obj;
delete_Decisionset(arg1);
}
static int _proxy__wrap_new_Decisionset(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Decisionset);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Decisionset_attributes[] = {
    { "solv", _wrap_Decisionset_solv_get, SWIG_Lua_set_immutable },
    { "p", _wrap_Decisionset_p_get, SWIG_Lua_set_immutable },
    { "reason", _wrap_Decisionset_reason_get, SWIG_Lua_set_immutable },
    { "infoid", _wrap_Decisionset_infoid_get, SWIG_Lua_set_immutable },
    { "bits", _wrap_Decisionset_bits_get, SWIG_Lua_set_immutable },
    { "type", _wrap_Decisionset_type_get, SWIG_Lua_set_immutable },
    { "dep_id", _wrap_Decisionset_dep_id_get, SWIG_Lua_set_immutable },
    { "dep", _wrap_Decisionset_dep_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Decisionset_methods[]= {
    { "info", _wrap_Decisionset_info},
    { "solvables", _wrap_Decisionset_solvables},
    { "decisions", _wrap_Decisionset_decisions},
    { "reasonstr", _wrap_Decisionset_reasonstr},
    { "__tostring", _wrap_Decisionset___tostring},
    {0,0}
};
static swig_lua_method swig_Decisionset_meta[] = {
    { "__tostring", _wrap_Decisionset___tostring},
    {0,0}
};

static swig_lua_attribute swig_Decisionset_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Decisionset_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Decisionset_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Decisionset_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Decisionset_Sf_SwigStatic = {
    "Decisionset",
    swig_Decisionset_Sf_SwigStatic_methods,
    swig_Decisionset_Sf_SwigStatic_attributes,
    swig_Decisionset_Sf_SwigStatic_constants,
    swig_Decisionset_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Decisionset_bases[] = {0};
static const char *swig_Decisionset_base_names[] = {0};
static swig_lua_class _wrap_class_Decisionset = { "Decisionset", "Decisionset", &SWIGTYPE_p_Decisionset,_proxy__wrap_new_Decisionset, swig_delete_Decisionset, swig_Decisionset_methods, swig_Decisionset_attributes, &swig_Decisionset_Sf_SwigStatic, swig_Decisionset_meta, swig_Decisionset_bases, swig_Decisionset_base_names };

static int _wrap_Solver_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Solver::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::pool",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_pool_get",1,SWIGTYPE_p_Solver);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_set_flag(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  int result;
  
  SWIG_check_num_args("Solver::set_flag",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::set_flag",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Solver::set_flag",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Solver::set_flag",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_set_flag",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (int)lua_tonumber(L, 3);
  result = (int)Solver_set_flag(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_flag(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("Solver::get_flag",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_flag",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Solver::get_flag",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_flag",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)Solver_get_flag(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_solve(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Queue arg2 ;
  Queue result;
  
  {
    queue_init(&arg2);
  }
  SWIG_check_num_args("Solver::solve",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::solve",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_solve",1,SWIGTYPE_p_Solver);
  }
  
  {
    int i;
    luaL_checktype(L, -1, LUA_TTABLE);
    for (i = 1; i; i++) {
      lua_rawgeti(L, -1, i);
      if (lua_type(L, -1) == LUA_TNIL)
      i = -1;
      else
      {
        Job * obj;
        int e = SWIG_ConvertPtr(L, -1, (void **)&obj, SWIGTYPE_p_Job, 0 | 0);
        if (!SWIG_IsOK(e))
        {
          lua_pop(L, 1);
          SWIG_Lua_pusherrstring(L,"list in argument 2 must contain only ""Job *");
          SWIG_fail;
        }
        queue_push2(&arg2, obj->how, obj->what);
      }
      lua_pop(L, 1);
    }
  }
  
  result = Solver_solve(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Problem * result = new_Problem(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Problem,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  {
    queue_free(&arg2);
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  {
    queue_free(&arg2);
  }
  lua_error(L);
  return 0;
}


static int _wrap_Solver_transaction(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Transaction *result = 0 ;
  
  SWIG_check_num_args("Solver::transaction",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::transaction",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_transaction",1,SWIGTYPE_p_Solver);
  }
  
  result = (Transaction *)Solver_transaction(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Transaction,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_describe_decision(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  XRule **arg3 = 0 ;
  XRule *temp3 ;
  int result;
  
  arg3 = &temp3;
  SWIG_check_num_args("Solver::describe_decision",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::describe_decision",1,"Solver *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Solver::describe_decision",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_describe_decision",1,SWIGTYPE_p_Solver);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Solver_describe_decision",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (int)Solver_describe_decision(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  SWIG_NewPointerObj(L, (void *)(*arg3), SWIGTYPE_p_XRule, SWIG_POINTER_OWN); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_describe_weakdep_decision_raw(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::describe_weakdep_decision_raw",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::describe_weakdep_decision_raw",1,"Solver *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Solver::describe_weakdep_decision_raw",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_describe_weakdep_decision_raw",1,SWIGTYPE_p_Solver);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Solver_describe_weakdep_decision_raw",2,SWIGTYPE_p_XSolvable);
  }
  
  result = Solver_describe_weakdep_decision_raw(arg1,arg2);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_alternatives_count(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Solver::alternatives_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::alternatives_count",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_alternatives_count",1,SWIGTYPE_p_Solver);
  }
  
  result = (int)Solver_alternatives_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_alternative(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  Alternative *result = 0 ;
  
  SWIG_check_num_args("Solver::get_alternative",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_alternative",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Solver::get_alternative",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_alternative",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Alternative *)Solver_get_alternative(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Alternative,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_alternatives(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::alternatives",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::alternatives",1,"Solver *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_alternatives",1,SWIGTYPE_p_Solver);
  }
  
  result = Solver_alternatives(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Alternative * result = Solver_get_alternative(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Alternative,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_write_testcase(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  char *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Solver::write_testcase",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::write_testcase",1,"Solver *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Solver::write_testcase",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_write_testcase",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (bool)Solver_write_testcase(arg1,(char const *)arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_raw_decisions(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  int arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::raw_decisions",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::raw_decisions",1,"Solver *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Solver::raw_decisions",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_raw_decisions",1,SWIGTYPE_p_Solver);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = Solver_raw_decisions(arg1,arg2);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_all_decisions(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  int arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::all_decisions",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::all_decisions",1,"Solver *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Solver::all_decisions",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_all_decisions",1,SWIGTYPE_p_Solver);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = Solver_all_decisions(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Decision * result = new_Decision(arg1, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_decision(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  Decision *result = 0 ;
  
  SWIG_check_num_args("Solver::get_decision",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_decision",1,"Solver *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Solver::get_decision",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_decision",1,SWIGTYPE_p_Solver);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Solver_get_decision",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (Decision *)Solver_get_decision(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_learnt(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::get_learnt",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_learnt",1,"Solver *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Solver::get_learnt",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_learnt",1,SWIGTYPE_p_Solver);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Solver_get_learnt",2,SWIGTYPE_p_XSolvable);
  }
  
  result = Solver_get_learnt(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XRule * result = new_XRule(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_decisionlist(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::get_decisionlist",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_decisionlist",1,"Solver *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Solver::get_decisionlist",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_decisionlist",1,SWIGTYPE_p_Solver);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Solver_get_decisionlist",2,SWIGTYPE_p_XSolvable);
  }
  
  result = Solver_get_decisionlist(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Decision * result = new_Decision(arg1, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_recommended(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  bool arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::get_recommended",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_recommended",1,"Solver *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Solver::get_recommended",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_recommended",1,SWIGTYPE_p_Solver);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  result = Solver_get_recommended(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solver_get_suggested(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  bool arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solver::get_suggested",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solver::get_suggested",1,"Solver *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Solver::get_suggested",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("Solver_get_suggested",1,SWIGTYPE_p_Solver);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  result = Solver_get_suggested(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Solver(void *obj) {
Solver *arg1 = (Solver *) obj;
delete_Solver(arg1);
}
static swig_lua_attribute swig_Solver_attributes[] = {
    { "pool", _wrap_Solver_pool_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Solver_methods[]= {
    { "set_flag", _wrap_Solver_set_flag},
    { "get_flag", _wrap_Solver_get_flag},
    { "solve", _wrap_Solver_solve},
    { "transaction", _wrap_Solver_transaction},
    { "describe_decision", _wrap_Solver_describe_decision},
    { "describe_weakdep_decision_raw", _wrap_Solver_describe_weakdep_decision_raw},
    { "alternatives_count", _wrap_Solver_alternatives_count},
    { "get_alternative", _wrap_Solver_get_alternative},
    { "alternatives", _wrap_Solver_alternatives},
    { "write_testcase", _wrap_Solver_write_testcase},
    { "raw_decisions", _wrap_Solver_raw_decisions},
    { "all_decisions", _wrap_Solver_all_decisions},
    { "get_decision", _wrap_Solver_get_decision},
    { "get_learnt", _wrap_Solver_get_learnt},
    { "get_decisionlist", _wrap_Solver_get_decisionlist},
    { "get_recommended", _wrap_Solver_get_recommended},
    { "get_suggested", _wrap_Solver_get_suggested},
    {0,0}
};
static swig_lua_method swig_Solver_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Solver_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Solver_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_UNKNOWN", (SOLVER_RULE_UNKNOWN))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG", (SOLVER_RULE_PKG))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_NOT_INSTALLABLE", (SOLVER_RULE_PKG_NOT_INSTALLABLE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP", (SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_REQUIRES", (SOLVER_RULE_PKG_REQUIRES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_SELF_CONFLICT", (SOLVER_RULE_PKG_SELF_CONFLICT))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_CONFLICTS", (SOLVER_RULE_PKG_CONFLICTS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_SAME_NAME", (SOLVER_RULE_PKG_SAME_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_OBSOLETES", (SOLVER_RULE_PKG_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_IMPLICIT_OBSOLETES", (SOLVER_RULE_PKG_IMPLICIT_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_INSTALLED_OBSOLETES", (SOLVER_RULE_PKG_INSTALLED_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_RECOMMENDS", (SOLVER_RULE_PKG_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_CONSTRAINS", (SOLVER_RULE_PKG_CONSTRAINS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_PKG_SUPPLEMENTS", (SOLVER_RULE_PKG_SUPPLEMENTS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_UPDATE", (SOLVER_RULE_UPDATE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_FEATURE", (SOLVER_RULE_FEATURE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_JOB", (SOLVER_RULE_JOB))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP", (SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM", (SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_JOB_UNKNOWN_PACKAGE", (SOLVER_RULE_JOB_UNKNOWN_PACKAGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_JOB_UNSUPPORTED", (SOLVER_RULE_JOB_UNSUPPORTED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_DISTUPGRADE", (SOLVER_RULE_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_INFARCH", (SOLVER_RULE_INFARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_CHOICE", (SOLVER_RULE_CHOICE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_LEARNT", (SOLVER_RULE_LEARNT))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_BEST", (SOLVER_RULE_BEST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_YUMOBS", (SOLVER_RULE_YUMOBS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_RECOMMENDS", (SOLVER_RULE_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_BLACK", (SOLVER_RULE_BLACK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_STRICT_REPO_PRIORITY", (SOLVER_RULE_STRICT_REPO_PRIORITY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_JOB", (SOLVER_SOLUTION_JOB))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_POOLJOB", (SOLVER_SOLUTION_POOLJOB))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_INFARCH", (SOLVER_SOLUTION_INFARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_DISTUPGRADE", (SOLVER_SOLUTION_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_BEST", (SOLVER_SOLUTION_BEST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_ERASE", (SOLVER_SOLUTION_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_REPLACE", (SOLVER_SOLUTION_REPLACE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_REPLACE_DOWNGRADE", (SOLVER_SOLUTION_REPLACE_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_REPLACE_ARCHCHANGE", (SOLVER_SOLUTION_REPLACE_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_REPLACE_VENDORCHANGE", (SOLVER_SOLUTION_REPLACE_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_SOLUTION_REPLACE_NAMECHANGE", (SOLVER_SOLUTION_REPLACE_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("POLICY_ILLEGAL_DOWNGRADE", (POLICY_ILLEGAL_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("POLICY_ILLEGAL_ARCHCHANGE", (POLICY_ILLEGAL_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("POLICY_ILLEGAL_VENDORCHANGE", (POLICY_ILLEGAL_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("POLICY_ILLEGAL_NAMECHANGE", (POLICY_ILLEGAL_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ALLOW_DOWNGRADE", (SOLVER_FLAG_ALLOW_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ALLOW_ARCHCHANGE", (SOLVER_FLAG_ALLOW_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ALLOW_VENDORCHANGE", (SOLVER_FLAG_ALLOW_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ALLOW_NAMECHANGE", (SOLVER_FLAG_ALLOW_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ALLOW_UNINSTALL", (SOLVER_FLAG_ALLOW_UNINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_NO_UPDATEPROVIDE", (SOLVER_FLAG_NO_UPDATEPROVIDE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_SPLITPROVIDES", (SOLVER_FLAG_SPLITPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_IGNORE_RECOMMENDED", (SOLVER_FLAG_IGNORE_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ADD_ALREADY_RECOMMENDED", (SOLVER_FLAG_ADD_ALREADY_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_NO_INFARCHCHECK", (SOLVER_FLAG_NO_INFARCHCHECK))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_BEST_OBEY_POLICY", (SOLVER_FLAG_BEST_OBEY_POLICY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_NO_AUTOTARGET", (SOLVER_FLAG_NO_AUTOTARGET))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_DUP_ALLOW_DOWNGRADE", (SOLVER_FLAG_DUP_ALLOW_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE", (SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE", (SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_DUP_ALLOW_NAMECHANGE", (SOLVER_FLAG_DUP_ALLOW_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_KEEP_ORPHANS", (SOLVER_FLAG_KEEP_ORPHANS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_BREAK_ORPHANS", (SOLVER_FLAG_BREAK_ORPHANS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_FOCUS_INSTALLED", (SOLVER_FLAG_FOCUS_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_YUM_OBSOLETES", (SOLVER_FLAG_YUM_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_NEED_UPDATEPROVIDE", (SOLVER_FLAG_NEED_UPDATEPROVIDE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_FOCUS_BEST", (SOLVER_FLAG_FOCUS_BEST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_STRONG_RECOMMENDS", (SOLVER_FLAG_STRONG_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_INSTALL_ALSO_UPDATES", (SOLVER_FLAG_INSTALL_ALSO_UPDATES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED", (SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_STRICT_REPO_PRIORITY", (SOLVER_FLAG_STRICT_REPO_PRIORITY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_FLAG_FOCUS_NEW", (SOLVER_FLAG_FOCUS_NEW))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_UNRELATED", (SOLVER_REASON_UNRELATED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_UNIT_RULE", (SOLVER_REASON_UNIT_RULE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_KEEP_INSTALLED", (SOLVER_REASON_KEEP_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_RESOLVE_JOB", (SOLVER_REASON_RESOLVE_JOB))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_UPDATE_INSTALLED", (SOLVER_REASON_UPDATE_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_CLEANDEPS_ERASE", (SOLVER_REASON_CLEANDEPS_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_RESOLVE", (SOLVER_REASON_RESOLVE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_WEAKDEP", (SOLVER_REASON_WEAKDEP))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_RESOLVE_ORPHAN", (SOLVER_REASON_RESOLVE_ORPHAN))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_RECOMMENDED", (SOLVER_REASON_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_SUPPLEMENTED", (SOLVER_REASON_SUPPLEMENTED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_UNSOLVABLE", (SOLVER_REASON_UNSOLVABLE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_REASON_PREMISE", (SOLVER_REASON_PREMISE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_RULE_RPM", (SOLVER_RULE_RPM))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Solver_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Solver_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Solver_Sf_SwigStatic = {
    "Solver",
    swig_Solver_Sf_SwigStatic_methods,
    swig_Solver_Sf_SwigStatic_attributes,
    swig_Solver_Sf_SwigStatic_constants,
    swig_Solver_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Solver_bases[] = {0};
static const char *swig_Solver_base_names[] = {0};
static swig_lua_class _wrap_class_Solver = { "Solver", "Solver", &SWIGTYPE_p_Solver,0, swig_delete_Solver, swig_Solver_methods, swig_Solver_attributes, &swig_Solver_Sf_SwigStatic, swig_Solver_meta, swig_Solver_bases, swig_Solver_base_names };

static int _wrap_new_Chksum__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  Id arg1 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("Chksum::Chksum",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Chksum::Chksum",1,"Id");
  arg1 = (Id)lua_tonumber(L, 1);
  result = (Chksum *)new_Chksum__SWIG_0(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Chksum__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  Id arg1 ;
  char *arg2 = 0 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("Chksum::Chksum",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Chksum::Chksum",1,"Id");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Chksum::Chksum",2,"char const *");
  arg1 = (Id)lua_tonumber(L, 1);
  arg2 = (char *)lua_tostring(L, 2);
  result = (Chksum *)new_Chksum__SWIG_1(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Chksum(lua_State* L) {
  int argc;
  int argv[3]={
    1,2,3
  };
  
  argc = lua_gettop(L);
  if (argc == 1) {
    int _v = 0;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_Chksum__SWIG_0(L);
    }
  }
  if (argc == 2) {
    int _v = 0;
    {
      _v = lua_isnumber(L,argv[0]);
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_new_Chksum__SWIG_1(L);
      }
    }
  }
  
  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Chksum'\n"
    "  Possible C/C++ prototypes are:\n"
    "    Chksum::Chksum(Id)\n"
    "    Chksum::Chksum(Id,char const *)\n");
  lua_error(L);return 0;
}


static int _wrap_Chksum_from_bin(lua_State* L) {
  int SWIG_arg = 0;
  Id arg1 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  Chksum *result = 0 ;
  
  SWIG_check_num_args("Chksum::Chksum_from_bin",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("Chksum::Chksum_from_bin",1,"Id");
  arg1 = (Id)lua_tonumber(L, 1);
  if (!lua_isstring(L, 2)) SWIG_fail_arg(Chksum_from_bin, 2, "const char *");
  buf2 = (char *)lua_tolstring(L, 2, &size2);
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  result = (Chksum *)Chksum_from_bin(arg1,(unsigned char const *)arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Chksum,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_type_get(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Chksum::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::type",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_type_get",1,SWIGTYPE_p_Chksum);
  }
  
  result = (Id)Chksum_type_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_add(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  
  SWIG_check_num_args("Chksum::add",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::add",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_add",1,SWIGTYPE_p_Chksum);
  }
  
  if (!lua_isstring(L, 2)) SWIG_fail_arg(Chksum_add, 2, "const char *");
  buf2 = (char *)lua_tolstring(L, 2, &size2);
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  Chksum_add(arg1,(unsigned char const *)arg2,arg3);
  {
    lua_pushvalue(L, 1);SWIG_arg++;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_add_fp(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  FILE *arg2 = 0 ;
  FILE *val2 ;
  int ecode2 ;
  
  SWIG_check_num_args("Chksum::add_fp",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::add_fp",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_add_fp",1,SWIGTYPE_p_Chksum);
  }
  
  ecode2 = SWIG_AsValSolvFpPtr(L, 2, &val2);
  if (!SWIG_IsOK(ecode2)) SWIG_fail_arg("Chksum_add_fp", 2, "FILE *");
  arg2 = val2;
  Chksum_add_fp(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_add_fd(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Chksum::add_fd",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::add_fd",1,"Chksum *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Chksum::add_fd",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_add_fd",1,SWIGTYPE_p_Chksum);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  Chksum_add_fd(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_add_stat(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  char *arg2 = 0 ;
  
  SWIG_check_num_args("Chksum::add_stat",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::add_stat",1,"Chksum *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Chksum::add_stat",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_add_stat",1,SWIGTYPE_p_Chksum);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  Chksum_add_stat(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_add_fstat(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  int arg2 ;
  
  SWIG_check_num_args("Chksum::add_fstat",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::add_fstat",1,"Chksum *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Chksum::add_fstat",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_add_fstat",1,SWIGTYPE_p_Chksum);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  Chksum_add_fstat(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_raw(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  BinaryBlob result;
  
  SWIG_check_num_args("Chksum::raw",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::raw",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_raw",1,SWIGTYPE_p_Chksum);
  }
  
  result = Chksum_raw(arg1);
  if ((&result)->data) {
    lua_pushlstring(L, (&result)->data, (&result)->len);
  } else {
    lua_pushnil(L);
  }
  SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_hex(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Chksum::hex",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::hex",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_hex",1,SWIGTYPE_p_Chksum);
  }
  
  result = (char *)Chksum_hex(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_typestr(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Chksum::typestr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::typestr",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_typestr",1,SWIGTYPE_p_Chksum);
  }
  
  result = (char *)Chksum_typestr(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum___eq(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  Chksum *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Chksum::__eq__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::__eq__",1,"Chksum *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Chksum::__eq__",2,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum___eq",1,SWIGTYPE_p_Chksum);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum___eq",2,SWIGTYPE_p_Chksum);
  }
  
  result = (bool)Chksum___eq__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum___ne(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  Chksum *arg2 = 0 ;
  bool result;
  
  SWIG_check_num_args("Chksum::__ne__",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::__ne__",1,"Chksum *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Chksum::__ne__",2,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum___ne",1,SWIGTYPE_p_Chksum);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum___ne",2,SWIGTYPE_p_Chksum);
  }
  
  result = (bool)Chksum___ne__(arg1,arg2);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Chksum::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::__str__",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum___tostring",1,SWIGTYPE_p_Chksum);
  }
  
  result = (char *)Chksum___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Chksum_repr(lua_State* L) {
  int SWIG_arg = 0;
  Chksum *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Chksum::__repr__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Chksum::__repr__",1,"Chksum *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Chksum,0))){
    SWIG_fail_ptr("Chksum_repr",1,SWIGTYPE_p_Chksum);
  }
  
  result = (char *)Chksum___repr__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Chksum(void *obj) {
Chksum *arg1 = (Chksum *) obj;
delete_Chksum(arg1);
}
static int _proxy__wrap_new_Chksum(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Chksum);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Chksum_attributes[] = {
    { "type", _wrap_Chksum_type_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Chksum_methods[]= {
    { "add", _wrap_Chksum_add},
    { "add_fp", _wrap_Chksum_add_fp},
    { "add_fd", _wrap_Chksum_add_fd},
    { "add_stat", _wrap_Chksum_add_stat},
    { "add_fstat", _wrap_Chksum_add_fstat},
    { "raw", _wrap_Chksum_raw},
    { "hex", _wrap_Chksum_hex},
    { "typestr", _wrap_Chksum_typestr},
    { "__eq", _wrap_Chksum___eq},
    { "__ne", _wrap_Chksum___ne},
    { "__tostring", _wrap_Chksum___tostring},
    { "repr", _wrap_Chksum_repr},
    {0,0}
};
static swig_lua_method swig_Chksum_meta[] = {
    { "__eq", _wrap_Chksum___eq},
    { "__ne", _wrap_Chksum___ne},
    { "__tostring", _wrap_Chksum___tostring},
    {0,0}
};

static swig_lua_attribute swig_Chksum_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Chksum_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Chksum_Sf_SwigStatic_methods[]= {
    { "from_bin", _wrap_Chksum_from_bin},
    {0,0}
};
static swig_lua_class* swig_Chksum_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Chksum_Sf_SwigStatic = {
    "Chksum",
    swig_Chksum_Sf_SwigStatic_methods,
    swig_Chksum_Sf_SwigStatic_attributes,
    swig_Chksum_Sf_SwigStatic_constants,
    swig_Chksum_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Chksum_bases[] = {0};
static const char *swig_Chksum_base_names[] = {0};
static swig_lua_class _wrap_class_Chksum = { "Chksum", "Chksum", &SWIGTYPE_p_Chksum,_proxy__wrap_new_Chksum, swig_delete_Chksum, swig_Chksum_methods, swig_Chksum_attributes, &swig_Chksum_Sf_SwigStatic, swig_Chksum_meta, swig_Chksum_bases, swig_Chksum_base_names };

static int _wrap_SolvFp_fileno(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("SolvFp::fileno",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::fileno",1,"SolvFp *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_fileno",1,SWIGTYPE_p_SolvFp);
  }
  
  result = (int)SolvFp_fileno(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_SolvFp_dup(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("SolvFp::dup",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::dup",1,"SolvFp *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_dup",1,SWIGTYPE_p_SolvFp);
  }
  
  result = (int)SolvFp_dup(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_SolvFp_write(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  bool result;
  
  SWIG_check_num_args("SolvFp::write",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::write",1,"SolvFp *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_write",1,SWIGTYPE_p_SolvFp);
  }
  
  if (!lua_isstring(L, 2)) SWIG_fail_arg(SolvFp_write, 2, "const char *");
  buf2 = (char *)lua_tolstring(L, 2, &size2);
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  result = (bool)SolvFp_write(arg1,(unsigned char const *)arg2,arg3);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_SolvFp_flush(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("SolvFp::flush",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::flush",1,"SolvFp *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_flush",1,SWIGTYPE_p_SolvFp);
  }
  
  result = (bool)SolvFp_flush(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_SolvFp_close(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("SolvFp::close",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::close",1,"SolvFp *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_close",1,SWIGTYPE_p_SolvFp);
  }
  
  result = (bool)SolvFp_close(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_SolvFp_cloexec(lua_State* L) {
  int SWIG_arg = 0;
  SolvFp *arg1 = 0 ;
  bool arg2 ;
  
  SWIG_check_num_args("SolvFp::cloexec",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("SolvFp::cloexec",1,"SolvFp *");
  if(!lua_isboolean(L,2)) SWIG_fail_arg("SolvFp::cloexec",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_SolvFp,0))){
    SWIG_fail_ptr("SolvFp_cloexec",1,SWIGTYPE_p_SolvFp);
  }
  
  arg2 = (lua_toboolean(L, 2)!=0);
  SolvFp_cloexec(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_SolvFp(void *obj) {
SolvFp *arg1 = (SolvFp *) obj;
delete_SolvFp(arg1);
}
static swig_lua_attribute swig_SolvFp_attributes[] = {
    {0,0,0}
};
static swig_lua_method swig_SolvFp_methods[]= {
    { "fileno", _wrap_SolvFp_fileno},
    { "dup", _wrap_SolvFp_dup},
    { "write", _wrap_SolvFp_write},
    { "flush", _wrap_SolvFp_flush},
    { "close", _wrap_SolvFp_close},
    { "cloexec", _wrap_SolvFp_cloexec},
    {0,0}
};
static swig_lua_method swig_SolvFp_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_SolvFp_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_SolvFp_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_SolvFp_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_SolvFp_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_SolvFp_SwigStatic = {
    "SolvFp",
    swig_SolvFp_SwigStatic_methods,
    swig_SolvFp_SwigStatic_attributes,
    swig_SolvFp_SwigStatic_constants,
    swig_SolvFp_SwigStatic_classes,
    0
};
static swig_lua_class *swig_SolvFp_bases[] = {0};
static const char *swig_SolvFp_base_names[] = {0};
static swig_lua_class _wrap_class_SolvFp = { "SolvFp", "SolvFp", &SWIGTYPE_p_SolvFp,0, swig_delete_SolvFp, swig_SolvFp_methods, swig_SolvFp_attributes, &swig_SolvFp_SwigStatic, swig_SolvFp_meta, swig_SolvFp_bases, swig_SolvFp_base_names };

static int _wrap_xfopen(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = 0 ;
  char *arg2 = 0 ;
  SolvFp *result = 0 ;
  
  SWIG_check_num_args("solvfp_xfopen",1,2)
  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("solvfp_xfopen",1,"char const *");
  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("solvfp_xfopen",2,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  if(lua_gettop(L)>=2){
    arg2 = (char *)lua_tostring(L, 2);
  }
  result = (SolvFp *)solvfp_xfopen((char const *)arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_SolvFp,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_xfopen_fd(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = 0 ;
  int arg2 ;
  char *arg3 = 0 ;
  SolvFp *result = 0 ;
  
  SWIG_check_num_args("solvfp_xfopen_fd",2,3)
  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("solvfp_xfopen_fd",1,"char const *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("solvfp_xfopen_fd",2,"int");
  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("solvfp_xfopen_fd",3,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  arg2 = (int)lua_tonumber(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  result = (SolvFp *)solvfp_xfopen_fd((char const *)arg1,arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_SolvFp,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Problem::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::solv",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_solv_get",1,SWIGTYPE_p_Problem);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Problem::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::id",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_id_get",1,SWIGTYPE_p_Problem);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Problem(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  Problem *result = 0 ;
  
  SWIG_check_num_args("Problem::Problem",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::Problem",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Problem::Problem",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_Problem",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Problem *)new_Problem(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Problem,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_findproblemrule(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  XRule *result = 0 ;
  
  SWIG_check_num_args("Problem::findproblemrule",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::findproblemrule",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_findproblemrule",1,SWIGTYPE_p_Problem);
  }
  
  result = (XRule *)Problem_findproblemrule(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_findallproblemrules(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  int arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Problem::findallproblemrules",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::findallproblemrules",1,"Problem *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Problem::findallproblemrules",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_findallproblemrules",1,SWIGTYPE_p_Problem);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = Problem_findallproblemrules(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XRule * result = new_XRule(arg1->solv, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_solution_count(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Problem::solution_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::solution_count",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_solution_count",1,SWIGTYPE_p_Problem);
  }
  
  result = (int)Problem_solution_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_solutions(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Problem::solutions",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::solutions",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_solutions",1,SWIGTYPE_p_Problem);
  }
  
  result = Problem_solutions(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Solution * result = new_Solution(arg1, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solution,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_get_learnt(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Problem::get_learnt",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::get_learnt",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_get_learnt",1,SWIGTYPE_p_Problem);
  }
  
  result = Problem_get_learnt(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XRule * result = new_XRule(arg1->solv, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_get_decisionlist(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Problem::get_decisionlist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::get_decisionlist",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_get_decisionlist",1,SWIGTYPE_p_Problem);
  }
  
  result = Problem_get_decisionlist(arg1);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Decision * result = new_Decision(arg1->solv, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decision,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem_get_decisionsetlist(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Problem::get_decisionsetlist",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::get_decisionsetlist",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem_get_decisionsetlist",1,SWIGTYPE_p_Problem);
  }
  
  result = Problem_get_decisionsetlist(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Decisionset * result = decisionset_fromids(arg1->solv, idp + id, idp[1] - id + 1);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Decisionset,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Problem___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Problem::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Problem::__str__",1,"Problem *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("Problem___tostring",1,SWIGTYPE_p_Problem);
  }
  
  result = (char *)Problem___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Problem(void *obj) {
Problem *arg1 = (Problem *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Problem(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Problem);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Problem_attributes[] = {
    { "solv", _wrap_Problem_solv_get, SWIG_Lua_set_immutable },
    { "id", _wrap_Problem_id_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Problem_methods[]= {
    { "findproblemrule", _wrap_Problem_findproblemrule},
    { "findallproblemrules", _wrap_Problem_findallproblemrules},
    { "solution_count", _wrap_Problem_solution_count},
    { "solutions", _wrap_Problem_solutions},
    { "get_learnt", _wrap_Problem_get_learnt},
    { "get_decisionlist", _wrap_Problem_get_decisionlist},
    { "get_decisionsetlist", _wrap_Problem_get_decisionsetlist},
    { "__tostring", _wrap_Problem___tostring},
    {0,0}
};
static swig_lua_method swig_Problem_meta[] = {
    { "__tostring", _wrap_Problem___tostring},
    {0,0}
};

static swig_lua_attribute swig_Problem_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Problem_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Problem_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Problem_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Problem_Sf_SwigStatic = {
    "Problem",
    swig_Problem_Sf_SwigStatic_methods,
    swig_Problem_Sf_SwigStatic_attributes,
    swig_Problem_Sf_SwigStatic_constants,
    swig_Problem_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Problem_bases[] = {0};
static const char *swig_Problem_base_names[] = {0};
static swig_lua_class _wrap_class_Problem = { "Problem", "Problem", &SWIGTYPE_p_Problem,_proxy__wrap_new_Problem, swig_delete_Problem, swig_Problem_methods, swig_Problem_attributes, &swig_Problem_Sf_SwigStatic, swig_Problem_meta, swig_Problem_bases, swig_Problem_base_names };

static int _wrap_Solution_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Solution *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Solution::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::solv",1,"Solution *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solution,0))){
    SWIG_fail_ptr("Solution_solv_get",1,SWIGTYPE_p_Solution);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solution_problemid_get(lua_State* L) {
  int SWIG_arg = 0;
  Solution *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Solution::problemid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::problemid",1,"Solution *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solution,0))){
    SWIG_fail_ptr("Solution_problemid_get",1,SWIGTYPE_p_Solution);
  }
  
  result = (Id)(Id) ((arg1)->problemid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solution_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Solution *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Solution::id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::id",1,"Solution *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solution,0))){
    SWIG_fail_ptr("Solution_id_get",1,SWIGTYPE_p_Solution);
  }
  
  result = (Id)(Id) ((arg1)->id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Solution(lua_State* L) {
  int SWIG_arg = 0;
  Problem *arg1 = 0 ;
  Id arg2 ;
  Solution *result = 0 ;
  
  SWIG_check_num_args("Solution::Solution",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::Solution",1,"Problem *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Solution::Solution",2,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Problem,0))){
    SWIG_fail_ptr("new_Solution",1,SWIGTYPE_p_Problem);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  result = (Solution *)new_Solution(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solution,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solution_element_count(lua_State* L) {
  int SWIG_arg = 0;
  Solution *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Solution::element_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::element_count",1,"Solution *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solution,0))){
    SWIG_fail_ptr("Solution_element_count",1,SWIGTYPE_p_Solution);
  }
  
  result = (int)Solution_element_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solution_elements(lua_State* L) {
  int SWIG_arg = 0;
  Solution *arg1 = 0 ;
  bool arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solution::elements",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solution::elements",1,"Solution *");
  if(lua_gettop(L)>=2 && !lua_isboolean(L,2)) SWIG_fail_arg("Solution::elements",2,"bool");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solution,0))){
    SWIG_fail_ptr("Solution_elements",1,SWIGTYPE_p_Solution);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (lua_toboolean(L, 2)!=0);
  }
  result = Solution_elements(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 3;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 3)
  {
    Id id = *idp;
#define result resultx
    Solutionelement * result = new_Solutionelement(arg1->solv, arg1->problemid, arg1->id, id, idp[1], idp[2]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solutionelement,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Solution(void *obj) {
Solution *arg1 = (Solution *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Solution(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Solution);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Solution_attributes[] = {
    { "solv", _wrap_Solution_solv_get, SWIG_Lua_set_immutable },
    { "problemid", _wrap_Solution_problemid_get, SWIG_Lua_set_immutable },
    { "id", _wrap_Solution_id_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Solution_methods[]= {
    { "element_count", _wrap_Solution_element_count},
    { "elements", _wrap_Solution_elements},
    {0,0}
};
static swig_lua_method swig_Solution_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Solution_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Solution_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Solution_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Solution_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Solution_Sf_SwigStatic = {
    "Solution",
    swig_Solution_Sf_SwigStatic_methods,
    swig_Solution_Sf_SwigStatic_attributes,
    swig_Solution_Sf_SwigStatic_constants,
    swig_Solution_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Solution_bases[] = {0};
static const char *swig_Solution_base_names[] = {0};
static swig_lua_class _wrap_class_Solution = { "Solution", "Solution", &SWIGTYPE_p_Solution,_proxy__wrap_new_Solution, swig_delete_Solution, swig_Solution_methods, swig_Solution_attributes, &swig_Solution_Sf_SwigStatic, swig_Solution_meta, swig_Solution_bases, swig_Solution_base_names };

static int _wrap_Solutionelement_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::solv",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_solv_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_problemid_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Solutionelement::problemid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::problemid",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_problemid_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (Id)(Id) ((arg1)->problemid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_solutionid_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Solutionelement::solutionid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::solutionid",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_solutionid_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (Id)(Id) ((arg1)->solutionid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_type_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Solutionelement::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::type",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_type_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (Id)(Id) ((arg1)->type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_Solutionelement(lua_State* L) {
  int SWIG_arg = 0;
  Solver *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  Id arg5 ;
  Id arg6 ;
  Solutionelement *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::Solutionelement",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::Solutionelement",1,"Solver *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("Solutionelement::Solutionelement",2,"Id");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Solutionelement::Solutionelement",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("Solutionelement::Solutionelement",4,"Id");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("Solutionelement::Solutionelement",5,"Id");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("Solutionelement::Solutionelement",6,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solver,0))){
    SWIG_fail_ptr("new_Solutionelement",1,SWIGTYPE_p_Solver);
  }
  
  arg2 = (Id)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (Id)lua_tonumber(L, 4);
  arg5 = (Id)lua_tonumber(L, 5);
  arg6 = (Id)lua_tonumber(L, 6);
  result = (Solutionelement *)new_Solutionelement(arg1,arg2,arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solutionelement,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_str(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::str",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::str",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_str",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (char *)Solutionelement_str(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::__str__",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement___tostring",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (char *)Solutionelement___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_replaceelements(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Solutionelement::replaceelements",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::replaceelements",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_replaceelements",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = Solutionelement_replaceelements(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    Solutionelement * result = new_Solutionelement(arg1->solv, arg1->problemid, arg1->solutionid, id, arg1->p, arg1->rp);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solutionelement,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_illegalreplace(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Solutionelement::illegalreplace",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::illegalreplace",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_illegalreplace",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (int)Solutionelement_illegalreplace(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_solvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::solvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::solvable",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_solvable_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (XSolvable *)Solutionelement_solvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_replacement_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::replacement",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::replacement",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_replacement_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (XSolvable *)Solutionelement_replacement_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_jobidx_get(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Solutionelement::jobidx",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::jobidx",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_jobidx_get",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (int)Solutionelement_jobidx_get(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Solutionelement_Job(lua_State* L) {
  int SWIG_arg = 0;
  Solutionelement *arg1 = 0 ;
  Job *result = 0 ;
  
  SWIG_check_num_args("Solutionelement::Job",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Solutionelement::Job",1,"Solutionelement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Solutionelement,0))){
    SWIG_fail_ptr("Solutionelement_Job",1,SWIGTYPE_p_Solutionelement);
  }
  
  result = (Job *)Solutionelement_Job(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Job,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Solutionelement(void *obj) {
Solutionelement *arg1 = (Solutionelement *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_Solutionelement(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_Solutionelement);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_Solutionelement_attributes[] = {
    { "solv", _wrap_Solutionelement_solv_get, SWIG_Lua_set_immutable },
    { "problemid", _wrap_Solutionelement_problemid_get, SWIG_Lua_set_immutable },
    { "solutionid", _wrap_Solutionelement_solutionid_get, SWIG_Lua_set_immutable },
    { "type", _wrap_Solutionelement_type_get, SWIG_Lua_set_immutable },
    { "solvable", _wrap_Solutionelement_solvable_get, SWIG_Lua_set_immutable },
    { "replacement", _wrap_Solutionelement_replacement_get, SWIG_Lua_set_immutable },
    { "jobidx", _wrap_Solutionelement_jobidx_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Solutionelement_methods[]= {
    { "str", _wrap_Solutionelement_str},
    { "__tostring", _wrap_Solutionelement___tostring},
    { "replaceelements", _wrap_Solutionelement_replaceelements},
    { "illegalreplace", _wrap_Solutionelement_illegalreplace},
    { "Job", _wrap_Solutionelement_Job},
    {0,0}
};
static swig_lua_method swig_Solutionelement_meta[] = {
    { "__tostring", _wrap_Solutionelement___tostring},
    {0,0}
};

static swig_lua_attribute swig_Solutionelement_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Solutionelement_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Solutionelement_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Solutionelement_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Solutionelement_Sf_SwigStatic = {
    "Solutionelement",
    swig_Solutionelement_Sf_SwigStatic_methods,
    swig_Solutionelement_Sf_SwigStatic_attributes,
    swig_Solutionelement_Sf_SwigStatic_constants,
    swig_Solutionelement_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Solutionelement_bases[] = {0};
static const char *swig_Solutionelement_base_names[] = {0};
static swig_lua_class _wrap_class_Solutionelement = { "Solutionelement", "Solutionelement", &SWIGTYPE_p_Solutionelement,_proxy__wrap_new_Solutionelement, swig_delete_Solutionelement, swig_Solutionelement_methods, swig_Solutionelement_attributes, &swig_Solutionelement_Sf_SwigStatic, swig_Solutionelement_meta, swig_Solutionelement_bases, swig_Solutionelement_base_names };

static int _wrap_Alternative_solv_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Solver *result = 0 ;
  
  SWIG_check_num_args("Alternative::solv",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::solv",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_solv_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (Solver *)(Solver *) ((arg1)->solv);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Solver,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_type_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Alternative::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::type",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_type_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (Id)(Id) ((arg1)->type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_dep_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Alternative::dep_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::dep_id",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_dep_id_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (Id)(Id) ((arg1)->dep_id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_chosen_id_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("Alternative::chosen_id",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::chosen_id",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_chosen_id_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (Id)(Id) ((arg1)->chosen_id);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_level_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("Alternative::level",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::level",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_level_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (int)(int) ((arg1)->level);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_chosen_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Alternative::chosen",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::chosen",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_chosen_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (XSolvable *)Alternative_chosen_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_rule_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  XRule *result = 0 ;
  
  SWIG_check_num_args("Alternative::rule",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::rule",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_rule_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (XRule *)Alternative_rule_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XRule,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_depsolvable_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Alternative::depsolvable",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::depsolvable",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_depsolvable_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (XSolvable *)Alternative_depsolvable_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_dep_get(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Dep *result = 0 ;
  
  SWIG_check_num_args("Alternative::dep",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::dep",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_dep_get",1,SWIGTYPE_p_Alternative);
  }
  
  result = (Dep *)Alternative_dep_get(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Dep,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_choices_raw(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Alternative::choices_raw",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::choices_raw",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_choices_raw",1,SWIGTYPE_p_Alternative);
  }
  
  result = Alternative_choices_raw(arg1);
  {
    int i;
    lua_newtable(L);
    for (i = 0; i < (&result)->count; i++) {
      lua_pushnumber(L, (&result)->elements[i]);
      lua_rawseti(L, -2, i + 1);
    }
    queue_free(&result);
    SWIG_arg = 1;
  }
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative_choices(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Alternative::choices",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::choices",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative_choices",1,SWIGTYPE_p_Alternative);
  }
  
  result = Alternative_choices(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->solv->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,0); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Alternative___tostring(lua_State* L) {
  int SWIG_arg = 0;
  Alternative *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("Alternative::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Alternative::__str__",1,"Alternative *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Alternative,0))){
    SWIG_fail_ptr("Alternative___tostring",1,SWIGTYPE_p_Alternative);
  }
  
  result = (char *)Alternative___str__(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Alternative(void *obj) {
Alternative *arg1 = (Alternative *) obj;
delete_Alternative(arg1);
}
static swig_lua_attribute swig_Alternative_attributes[] = {
    { "solv", _wrap_Alternative_solv_get, SWIG_Lua_set_immutable },
    { "type", _wrap_Alternative_type_get, SWIG_Lua_set_immutable },
    { "dep_id", _wrap_Alternative_dep_id_get, SWIG_Lua_set_immutable },
    { "chosen_id", _wrap_Alternative_chosen_id_get, SWIG_Lua_set_immutable },
    { "level", _wrap_Alternative_level_get, SWIG_Lua_set_immutable },
    { "chosen", _wrap_Alternative_chosen_get, SWIG_Lua_set_immutable },
    { "rule", _wrap_Alternative_rule_get, SWIG_Lua_set_immutable },
    { "depsolvable", _wrap_Alternative_depsolvable_get, SWIG_Lua_set_immutable },
    { "dep", _wrap_Alternative_dep_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Alternative_methods[]= {
    { "choices_raw", _wrap_Alternative_choices_raw},
    { "choices", _wrap_Alternative_choices},
    { "__tostring", _wrap_Alternative___tostring},
    {0,0}
};
static swig_lua_method swig_Alternative_meta[] = {
    { "__tostring", _wrap_Alternative___tostring},
    {0,0}
};

static swig_lua_attribute swig_Alternative_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Alternative_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ALTERNATIVE_TYPE_RULE", (SOLVER_ALTERNATIVE_TYPE_RULE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ALTERNATIVE_TYPE_RECOMMENDS", (SOLVER_ALTERNATIVE_TYPE_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_ALTERNATIVE_TYPE_SUGGESTS", (SOLVER_ALTERNATIVE_TYPE_SUGGESTS))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Alternative_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Alternative_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Alternative_Sf_SwigStatic = {
    "Alternative",
    swig_Alternative_Sf_SwigStatic_methods,
    swig_Alternative_Sf_SwigStatic_attributes,
    swig_Alternative_Sf_SwigStatic_constants,
    swig_Alternative_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Alternative_bases[] = {0};
static const char *swig_Alternative_base_names[] = {0};
static swig_lua_class _wrap_class_Alternative = { "Alternative", "Alternative", &SWIGTYPE_p_Alternative,0, swig_delete_Alternative, swig_Alternative_methods, swig_Alternative_attributes, &swig_Alternative_Sf_SwigStatic, swig_Alternative_meta, swig_Alternative_bases, swig_Alternative_base_names };

static int _wrap_Transaction_pool_get(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Pool *result = 0 ;
  
  SWIG_check_num_args("Transaction::pool",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::pool",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_pool_get",1,SWIGTYPE_p_Transaction);
  }
  
  result = (Pool *)(Pool *) ((arg1)->pool);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Pool,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_isempty(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  bool result;
  
  SWIG_check_num_args("Transaction::isempty",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::isempty",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_isempty",1,SWIGTYPE_p_Transaction);
  }
  
  result = (bool)Transaction_isempty(arg1);
  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_othersolvable(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  XSolvable *result = 0 ;
  
  SWIG_check_num_args("Transaction::othersolvable",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::othersolvable",1,"Transaction *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Transaction::othersolvable",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_othersolvable",1,SWIGTYPE_p_Transaction);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Transaction_othersolvable",2,SWIGTYPE_p_XSolvable);
  }
  
  result = (XSolvable *)Transaction_othersolvable(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_allothersolvables(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::allothersolvables",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::allothersolvables",1,"Transaction *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Transaction::allothersolvables",2,"XSolvable *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_allothersolvables",1,SWIGTYPE_p_Transaction);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Transaction_allothersolvables",2,SWIGTYPE_p_XSolvable);
  }
  
  result = Transaction_allothersolvables(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_classify(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  int arg2 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::classify",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::classify",1,"Transaction *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Transaction::classify",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_classify",1,SWIGTYPE_p_Transaction);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  result = Transaction_classify(arg1,arg2);
  
  int i;
  int cnt = (&result)->count / 4;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 4)
  {
    Id id = *idp;
#define result resultx
    TransactionClass * result = new_TransactionClass(arg1, arg2, id, idp[1], idp[2], idp[3]);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_TransactionClass,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_newpackages(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::newpackages",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::newpackages",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_newpackages",1,SWIGTYPE_p_Transaction);
  }
  
  result = Transaction_newpackages(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_keptpackages(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::keptpackages",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::keptpackages",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_keptpackages",1,SWIGTYPE_p_Transaction);
  }
  
  result = Transaction_keptpackages(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_newsolvables(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::newsolvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::newsolvables",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_newsolvables",1,SWIGTYPE_p_Transaction);
  }
  
  result = Transaction_newsolvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_keptsolvables(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::keptsolvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::keptsolvables",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_keptsolvables",1,SWIGTYPE_p_Transaction);
  }
  
  result = Transaction_keptsolvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_steps(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("Transaction::steps",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::steps",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_steps",1,SWIGTYPE_p_Transaction);
  }
  
  result = Transaction_steps(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_steptype(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  int result;
  
  SWIG_check_num_args("Transaction::steptype",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::steptype",1,"Transaction *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Transaction::steptype",2,"XSolvable *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("Transaction::steptype",3,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_steptype",1,SWIGTYPE_p_Transaction);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XSolvable,0))){
    SWIG_fail_ptr("Transaction_steptype",2,SWIGTYPE_p_XSolvable);
  }
  
  arg3 = (int)lua_tonumber(L, 3);
  result = (int)Transaction_steptype(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_calc_installsizechange(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  long long result;
  
  SWIG_check_num_args("Transaction::calc_installsizechange",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::calc_installsizechange",1,"Transaction *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_calc_installsizechange",1,SWIGTYPE_p_Transaction);
  }
  
  result = (long long)Transaction_calc_installsizechange(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_Transaction_order(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  int arg2 = 0 ;
  
  SWIG_check_num_args("Transaction::order",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Transaction::order",1,"Transaction *");
  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Transaction::order",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("Transaction_order",1,SWIGTYPE_p_Transaction);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (int)lua_tonumber(L, 2);
  }
  Transaction_order(arg1,arg2);
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_Transaction(void *obj) {
Transaction *arg1 = (Transaction *) obj;
delete_Transaction(arg1);
}
static swig_lua_attribute swig_Transaction_attributes[] = {
    { "pool", _wrap_Transaction_pool_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_Transaction_methods[]= {
    { "isempty", _wrap_Transaction_isempty},
    { "othersolvable", _wrap_Transaction_othersolvable},
    { "allothersolvables", _wrap_Transaction_allothersolvables},
    { "classify", _wrap_Transaction_classify},
    { "newpackages", _wrap_Transaction_newpackages},
    { "keptpackages", _wrap_Transaction_keptpackages},
    { "newsolvables", _wrap_Transaction_newsolvables},
    { "keptsolvables", _wrap_Transaction_keptsolvables},
    { "steps", _wrap_Transaction_steps},
    { "steptype", _wrap_Transaction_steptype},
    { "calc_installsizechange", _wrap_Transaction_calc_installsizechange},
    { "order", _wrap_Transaction_order},
    {0,0}
};
static swig_lua_method swig_Transaction_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_Transaction_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_Transaction_Sf_SwigStatic_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_IGNORE", (SOLVER_TRANSACTION_IGNORE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_ERASE", (SOLVER_TRANSACTION_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_REINSTALLED", (SOLVER_TRANSACTION_REINSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_DOWNGRADED", (SOLVER_TRANSACTION_DOWNGRADED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_CHANGED", (SOLVER_TRANSACTION_CHANGED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_UPGRADED", (SOLVER_TRANSACTION_UPGRADED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_OBSOLETED", (SOLVER_TRANSACTION_OBSOLETED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_INSTALL", (SOLVER_TRANSACTION_INSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_REINSTALL", (SOLVER_TRANSACTION_REINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_DOWNGRADE", (SOLVER_TRANSACTION_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_CHANGE", (SOLVER_TRANSACTION_CHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_UPGRADE", (SOLVER_TRANSACTION_UPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_OBSOLETES", (SOLVER_TRANSACTION_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_MULTIINSTALL", (SOLVER_TRANSACTION_MULTIINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_MULTIREINSTALL", (SOLVER_TRANSACTION_MULTIREINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_MAXTYPE", (SOLVER_TRANSACTION_MAXTYPE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_SHOW_ACTIVE", (SOLVER_TRANSACTION_SHOW_ACTIVE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_SHOW_ALL", (SOLVER_TRANSACTION_SHOW_ALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_SHOW_OBSOLETES", (SOLVER_TRANSACTION_SHOW_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_SHOW_MULTIINSTALL", (SOLVER_TRANSACTION_SHOW_MULTIINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_CHANGE_IS_REINSTALL", (SOLVER_TRANSACTION_CHANGE_IS_REINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE", (SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_MERGE_VENDORCHANGES", (SOLVER_TRANSACTION_MERGE_VENDORCHANGES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_MERGE_ARCHCHANGES", (SOLVER_TRANSACTION_MERGE_ARCHCHANGES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_RPM_ONLY", (SOLVER_TRANSACTION_RPM_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_ARCHCHANGE", (SOLVER_TRANSACTION_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_VENDORCHANGE", (SOLVER_TRANSACTION_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVER_TRANSACTION_KEEP_ORDERDATA", (SOLVER_TRANSACTION_KEEP_ORDERDATA))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_Transaction_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_Transaction_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_Transaction_Sf_SwigStatic = {
    "Transaction",
    swig_Transaction_Sf_SwigStatic_methods,
    swig_Transaction_Sf_SwigStatic_attributes,
    swig_Transaction_Sf_SwigStatic_constants,
    swig_Transaction_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_Transaction_bases[] = {0};
static const char *swig_Transaction_base_names[] = {0};
static swig_lua_class _wrap_class_Transaction = { "Transaction", "Transaction", &SWIGTYPE_p_Transaction,0, swig_delete_Transaction, swig_Transaction_methods, swig_Transaction_attributes, &swig_Transaction_Sf_SwigStatic, swig_Transaction_meta, swig_Transaction_bases, swig_Transaction_base_names };

static int _wrap_TransactionClass_transaction_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  Transaction *result = 0 ;
  
  SWIG_check_num_args("TransactionClass::transaction",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::transaction",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_transaction_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (Transaction *)(Transaction *) ((arg1)->transaction);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Transaction,0); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_type_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("TransactionClass::type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::type",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_type_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (Id)(Id) ((arg1)->type);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_fromid_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("TransactionClass::fromid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::fromid",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_fromid_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (Id)(Id) ((arg1)->fromid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_toid_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  Id result;
  
  SWIG_check_num_args("TransactionClass::toid",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::toid",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_toid_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (Id)(Id) ((arg1)->toid);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_count_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  int result;
  
  SWIG_check_num_args("TransactionClass::count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::count",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_count_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (int)(int) ((arg1)->count);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_new_TransactionClass(lua_State* L) {
  int SWIG_arg = 0;
  Transaction *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  int arg4 ;
  Id arg5 ;
  Id arg6 ;
  TransactionClass *result = 0 ;
  
  SWIG_check_num_args("TransactionClass::TransactionClass",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::TransactionClass",1,"Transaction *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("TransactionClass::TransactionClass",2,"int");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("TransactionClass::TransactionClass",3,"Id");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("TransactionClass::TransactionClass",4,"int");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("TransactionClass::TransactionClass",5,"Id");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("TransactionClass::TransactionClass",6,"Id");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Transaction,0))){
    SWIG_fail_ptr("new_TransactionClass",1,SWIGTYPE_p_Transaction);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  arg3 = (Id)lua_tonumber(L, 3);
  arg4 = (int)lua_tonumber(L, 4);
  arg5 = (Id)lua_tonumber(L, 5);
  arg6 = (Id)lua_tonumber(L, 6);
  result = (TransactionClass *)new_TransactionClass(arg1,arg2,arg3,arg4,arg5,arg6);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_TransactionClass,1); SWIG_arg++; 
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_solvables(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  Queue result;
  
  SWIG_check_num_args("TransactionClass::solvables",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::solvables",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_solvables",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = TransactionClass_solvables(arg1);
  
  int i;
  int cnt = (&result)->count / 1;
  Id *idp = (&result)->elements;
  
  lua_newtable(L);
  for (i = 0; i < cnt; i++, idp += 1)
  {
    Id id = *idp;
#define result resultx
    XSolvable * result = new_XSolvable(arg1->transaction->pool, id);
    SWIG_NewPointerObj(L,result,SWIGTYPE_p_XSolvable,1); SWIG_arg++; 
    lua_rawseti(L, -2, i+1);
#undef result
  }
  queue_free(&result);
  SWIG_arg = 1;
  
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_fromstr_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("TransactionClass::fromstr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::fromstr",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_fromstr_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (char *)TransactionClass_fromstr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static int _wrap_TransactionClass_tostr_get(lua_State* L) {
  int SWIG_arg = 0;
  TransactionClass *arg1 = 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("TransactionClass::tostr",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("TransactionClass::tostr",1,"TransactionClass *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_TransactionClass,0))){
    SWIG_fail_ptr("TransactionClass_tostr_get",1,SWIGTYPE_p_TransactionClass);
  }
  
  result = (char *)TransactionClass_tostr_get(arg1);
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  fail: SWIGUNUSED;
  lua_error(L);
  return 0;
}


static void swig_delete_TransactionClass(void *obj) {
TransactionClass *arg1 = (TransactionClass *) obj;
free((char *) arg1);
}
static int _proxy__wrap_new_TransactionClass(lua_State *L) {
    assert(lua_istable(L,1));
    lua_pushcfunction(L,_wrap_new_TransactionClass);
    assert(!lua_isnil(L,-1));
    lua_replace(L,1); /* replace our table with real constructor */
    lua_call(L,lua_gettop(L)-1,1);
    return 1;
}
static swig_lua_attribute swig_TransactionClass_attributes[] = {
    { "transaction", _wrap_TransactionClass_transaction_get, SWIG_Lua_set_immutable },
    { "type", _wrap_TransactionClass_type_get, SWIG_Lua_set_immutable },
    { "fromid", _wrap_TransactionClass_fromid_get, SWIG_Lua_set_immutable },
    { "toid", _wrap_TransactionClass_toid_get, SWIG_Lua_set_immutable },
    { "count", _wrap_TransactionClass_count_get, SWIG_Lua_set_immutable },
    { "fromstr", _wrap_TransactionClass_fromstr_get, SWIG_Lua_set_immutable },
    { "tostr", _wrap_TransactionClass_tostr_get, SWIG_Lua_set_immutable },
    {0,0,0}
};
static swig_lua_method swig_TransactionClass_methods[]= {
    { "solvables", _wrap_TransactionClass_solvables},
    {0,0}
};
static swig_lua_method swig_TransactionClass_meta[] = {
    {0,0}
};

static swig_lua_attribute swig_TransactionClass_Sf_SwigStatic_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_TransactionClass_Sf_SwigStatic_constants[]= {
    {0,0,0,0,0,0}
};
static swig_lua_method swig_TransactionClass_Sf_SwigStatic_methods[]= {
    {0,0}
};
static swig_lua_class* swig_TransactionClass_Sf_SwigStatic_classes[]= {
    0
};

static swig_lua_namespace swig_TransactionClass_Sf_SwigStatic = {
    "TransactionClass",
    swig_TransactionClass_Sf_SwigStatic_methods,
    swig_TransactionClass_Sf_SwigStatic_attributes,
    swig_TransactionClass_Sf_SwigStatic_constants,
    swig_TransactionClass_Sf_SwigStatic_classes,
    0
};
static swig_lua_class *swig_TransactionClass_bases[] = {0};
static const char *swig_TransactionClass_base_names[] = {0};
static swig_lua_class _wrap_class_TransactionClass = { "TransactionClass", "TransactionClass", &SWIGTYPE_p_TransactionClass,_proxy__wrap_new_TransactionClass, swig_delete_TransactionClass, swig_TransactionClass_methods, swig_TransactionClass_attributes, &swig_TransactionClass_Sf_SwigStatic, swig_TransactionClass_meta, swig_TransactionClass_bases, swig_TransactionClass_base_names };

static swig_lua_attribute swig_SwigModule_attributes[] = {
    {0,0,0}
};
static swig_lua_const_info swig_SwigModule_constants[]= {
    {SWIG_LUA_CONSTTAB_INT("ID_NULL", (ID_NULL))},
    {SWIG_LUA_CONSTTAB_INT("ID_EMPTY", (ID_EMPTY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_NAME", (SOLVABLE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ARCH", (SOLVABLE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_EVR", (SOLVABLE_EVR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_VENDOR", (SOLVABLE_VENDOR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PROVIDES", (SOLVABLE_PROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_OBSOLETES", (SOLVABLE_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CONFLICTS", (SOLVABLE_CONFLICTS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_REQUIRES", (SOLVABLE_REQUIRES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_RECOMMENDS", (SOLVABLE_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SUGGESTS", (SOLVABLE_SUGGESTS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SUPPLEMENTS", (SOLVABLE_SUPPLEMENTS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ENHANCES", (SOLVABLE_ENHANCES))},
    {SWIG_LUA_CONSTTAB_INT("RPM_RPMDBID", (RPM_RPMDBID))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PREREQMARKER", (SOLVABLE_PREREQMARKER))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_FILEMARKER", (SOLVABLE_FILEMARKER))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_INSTALLED", (NAMESPACE_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_MODALIAS", (NAMESPACE_MODALIAS))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_SPLITPROVIDES", (NAMESPACE_SPLITPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_LANGUAGE", (NAMESPACE_LANGUAGE))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_FILESYSTEM", (NAMESPACE_FILESYSTEM))},
    {SWIG_LUA_CONSTTAB_INT("NAMESPACE_OTHERPROVIDERS", (NAMESPACE_OTHERPROVIDERS))},
    {SWIG_LUA_CONSTTAB_INT("SYSTEM_SYSTEM", (SYSTEM_SYSTEM))},
    {SWIG_LUA_CONSTTAB_INT("ARCH_SRC", (ARCH_SRC))},
    {SWIG_LUA_CONSTTAB_INT("ARCH_NOSRC", (ARCH_NOSRC))},
    {SWIG_LUA_CONSTTAB_INT("ARCH_NOARCH", (ARCH_NOARCH))},
    {SWIG_LUA_CONSTTAB_INT("ARCH_ALL", (ARCH_ALL))},
    {SWIG_LUA_CONSTTAB_INT("ARCH_ANY", (ARCH_ANY))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_SOLVABLES", (REPOSITORY_SOLVABLES))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_DELTAINFO", (REPOSITORY_DELTAINFO))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_EXTERNAL", (REPOSITORY_EXTERNAL))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_KEYS", (REPOSITORY_KEYS))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_LOCATION", (REPOSITORY_LOCATION))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_VOID", (REPOKEY_TYPE_VOID))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_CONSTANT", (REPOKEY_TYPE_CONSTANT))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_CONSTANTID", (REPOKEY_TYPE_CONSTANTID))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_ID", (REPOKEY_TYPE_ID))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_NUM", (REPOKEY_TYPE_NUM))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_DIR", (REPOKEY_TYPE_DIR))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_STR", (REPOKEY_TYPE_STR))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_BINARY", (REPOKEY_TYPE_BINARY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_IDARRAY", (REPOKEY_TYPE_IDARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_REL_IDARRAY", (REPOKEY_TYPE_REL_IDARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_DIRSTRARRAY", (REPOKEY_TYPE_DIRSTRARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_DIRNUMNUMARRAY", (REPOKEY_TYPE_DIRNUMNUMARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_MD5", (REPOKEY_TYPE_MD5))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_SHA1", (REPOKEY_TYPE_SHA1))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_SHA224", (REPOKEY_TYPE_SHA224))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_SHA256", (REPOKEY_TYPE_SHA256))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_SHA384", (REPOKEY_TYPE_SHA384))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_SHA512", (REPOKEY_TYPE_SHA512))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_FIXARRAY", (REPOKEY_TYPE_FIXARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_FLEXARRAY", (REPOKEY_TYPE_FLEXARRAY))},
    {SWIG_LUA_CONSTTAB_INT("REPOKEY_TYPE_DELETED", (REPOKEY_TYPE_DELETED))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SUMMARY", (SOLVABLE_SUMMARY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_DESCRIPTION", (SOLVABLE_DESCRIPTION))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_DISTRIBUTION", (SOLVABLE_DISTRIBUTION))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_AUTHORS", (SOLVABLE_AUTHORS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PACKAGER", (SOLVABLE_PACKAGER))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_GROUP", (SOLVABLE_GROUP))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_URL", (SOLVABLE_URL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_KEYWORDS", (SOLVABLE_KEYWORDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_LICENSE", (SOLVABLE_LICENSE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_BUILDTIME", (SOLVABLE_BUILDTIME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_BUILDHOST", (SOLVABLE_BUILDHOST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_EULA", (SOLVABLE_EULA))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CPEID", (SOLVABLE_CPEID))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MESSAGEINS", (SOLVABLE_MESSAGEINS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MESSAGEDEL", (SOLVABLE_MESSAGEDEL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_INSTALLSIZE", (SOLVABLE_INSTALLSIZE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_DISKUSAGE", (SOLVABLE_DISKUSAGE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_FILELIST", (SOLVABLE_FILELIST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_INSTALLTIME", (SOLVABLE_INSTALLTIME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MEDIADIR", (SOLVABLE_MEDIADIR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MEDIAFILE", (SOLVABLE_MEDIAFILE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MEDIANR", (SOLVABLE_MEDIANR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MEDIABASE", (SOLVABLE_MEDIABASE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_DOWNLOADSIZE", (SOLVABLE_DOWNLOADSIZE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SOURCEARCH", (SOLVABLE_SOURCEARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SOURCENAME", (SOLVABLE_SOURCENAME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SOURCEEVR", (SOLVABLE_SOURCEEVR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ISVISIBLE", (SOLVABLE_ISVISIBLE))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_TRIGGERS", (SOLVABLE_TRIGGERS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CHECKSUM", (SOLVABLE_CHECKSUM))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PKGID", (SOLVABLE_PKGID))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_HDRID", (SOLVABLE_HDRID))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_LEADSIGID", (SOLVABLE_LEADSIGID))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PATCHCATEGORY", (SOLVABLE_PATCHCATEGORY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_HEADEREND", (SOLVABLE_HEADEREND))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CHANGELOG", (SOLVABLE_CHANGELOG))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CHANGELOG_AUTHOR", (SOLVABLE_CHANGELOG_AUTHOR))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CHANGELOG_TIME", (SOLVABLE_CHANGELOG_TIME))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CHANGELOG_TEXT", (SOLVABLE_CHANGELOG_TEXT))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_INSTALLSTATUS", (SOLVABLE_INSTALLSTATUS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_PREREQ_IGNOREINST", (SOLVABLE_PREREQ_IGNOREINST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CATEGORY", (SOLVABLE_CATEGORY))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_INCLUDES", (SOLVABLE_INCLUDES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_EXTENDS", (SOLVABLE_EXTENDS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ICON", (SOLVABLE_ICON))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ORDER", (SOLVABLE_ORDER))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REBOOT", (UPDATE_REBOOT))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_RESTART", (UPDATE_RESTART))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_RELOGIN", (UPDATE_RELOGIN))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MESSAGE", (UPDATE_MESSAGE))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_SEVERITY", (UPDATE_SEVERITY))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_RIGHTS", (UPDATE_RIGHTS))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION", (UPDATE_COLLECTION))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION_NAME", (UPDATE_COLLECTION_NAME))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION_EVR", (UPDATE_COLLECTION_EVR))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION_ARCH", (UPDATE_COLLECTION_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION_FILENAME", (UPDATE_COLLECTION_FILENAME))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTION_FLAGS", (UPDATE_COLLECTION_FLAGS))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REFERENCE", (UPDATE_REFERENCE))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REFERENCE_TYPE", (UPDATE_REFERENCE_TYPE))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REFERENCE_HREF", (UPDATE_REFERENCE_HREF))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REFERENCE_ID", (UPDATE_REFERENCE_ID))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_REFERENCE_TITLE", (UPDATE_REFERENCE_TITLE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_REFERENCEFILE", (PRODUCT_REFERENCEFILE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_SHORTLABEL", (PRODUCT_SHORTLABEL))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_DISTPRODUCT", (PRODUCT_DISTPRODUCT))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_DISTVERSION", (PRODUCT_DISTVERSION))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_TYPE", (PRODUCT_TYPE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_URL", (PRODUCT_URL))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_URL_TYPE", (PRODUCT_URL_TYPE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_FLAGS", (PRODUCT_FLAGS))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_PRODUCTLINE", (PRODUCT_PRODUCTLINE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_REGISTER_TARGET", (PRODUCT_REGISTER_TARGET))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_REGISTER_FLAVOR", (PRODUCT_REGISTER_FLAVOR))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_REGISTER_RELEASE", (PRODUCT_REGISTER_RELEASE))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_UPDATES_REPOID", (PRODUCT_UPDATES_REPOID))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_UPDATES", (PRODUCT_UPDATES))},
    {SWIG_LUA_CONSTTAB_INT("PRODUCT_ENDOFLIFE", (PRODUCT_ENDOFLIFE))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_DATADIR", (SUSETAGS_DATADIR))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_DESCRDIR", (SUSETAGS_DESCRDIR))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_DEFAULTVENDOR", (SUSETAGS_DEFAULTVENDOR))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_FILE", (SUSETAGS_FILE))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_FILE_NAME", (SUSETAGS_FILE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_FILE_TYPE", (SUSETAGS_FILE_TYPE))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_FILE_CHECKSUM", (SUSETAGS_FILE_CHECKSUM))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_SHARE_NAME", (SUSETAGS_SHARE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_SHARE_EVR", (SUSETAGS_SHARE_EVR))},
    {SWIG_LUA_CONSTTAB_INT("SUSETAGS_SHARE_ARCH", (SUSETAGS_SHARE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_ADDEDFILEPROVIDES", (REPOSITORY_ADDEDFILEPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_RPMDBCOOKIE", (REPOSITORY_RPMDBCOOKIE))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_FILTEREDFILELIST", (REPOSITORY_FILTEREDFILELIST))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_TIMESTAMP", (REPOSITORY_TIMESTAMP))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_EXPIRE", (REPOSITORY_EXPIRE))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_UPDATES", (REPOSITORY_UPDATES))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_DISTROS", (REPOSITORY_DISTROS))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_PRODUCT_LABEL", (REPOSITORY_PRODUCT_LABEL))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_PRODUCT_CPEID", (REPOSITORY_PRODUCT_CPEID))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOID", (REPOSITORY_REPOID))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_KEYWORDS", (REPOSITORY_KEYWORDS))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REVISION", (REPOSITORY_REVISION))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_TOOLVERSION", (REPOSITORY_TOOLVERSION))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_PACKAGE_NAME", (DELTA_PACKAGE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_PACKAGE_EVR", (DELTA_PACKAGE_EVR))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_PACKAGE_ARCH", (DELTA_PACKAGE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_LOCATION_DIR", (DELTA_LOCATION_DIR))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_LOCATION_NAME", (DELTA_LOCATION_NAME))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_LOCATION_EVR", (DELTA_LOCATION_EVR))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_LOCATION_SUFFIX", (DELTA_LOCATION_SUFFIX))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_DOWNLOADSIZE", (DELTA_DOWNLOADSIZE))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_CHECKSUM", (DELTA_CHECKSUM))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_BASE_EVR", (DELTA_BASE_EVR))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_SEQ_NAME", (DELTA_SEQ_NAME))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_SEQ_EVR", (DELTA_SEQ_EVR))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_SEQ_NUM", (DELTA_SEQ_NUM))},
    {SWIG_LUA_CONSTTAB_INT("DELTA_LOCATION_BASE", (DELTA_LOCATION_BASE))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD", (REPOSITORY_REPOMD))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_TYPE", (REPOSITORY_REPOMD_TYPE))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_LOCATION", (REPOSITORY_REPOMD_LOCATION))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_TIMESTAMP", (REPOSITORY_REPOMD_TIMESTAMP))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_CHECKSUM", (REPOSITORY_REPOMD_CHECKSUM))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_OPENCHECKSUM", (REPOSITORY_REPOMD_OPENCHECKSUM))},
    {SWIG_LUA_CONSTTAB_INT("REPOSITORY_REPOMD_SIZE", (REPOSITORY_REPOMD_SIZE))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_KEYID", (PUBKEY_KEYID))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_FINGERPRINT", (PUBKEY_FINGERPRINT))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_EXPIRES", (PUBKEY_EXPIRES))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_SIGNATURES", (PUBKEY_SIGNATURES))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_DATA", (PUBKEY_DATA))},
    {SWIG_LUA_CONSTTAB_INT("PUBKEY_SUBKEYOF", (PUBKEY_SUBKEYOF))},
    {SWIG_LUA_CONSTTAB_INT("SIGNATURE_ISSUER", (SIGNATURE_ISSUER))},
    {SWIG_LUA_CONSTTAB_INT("SIGNATURE_TIME", (SIGNATURE_TIME))},
    {SWIG_LUA_CONSTTAB_INT("SIGNATURE_EXPIRES", (SIGNATURE_EXPIRES))},
    {SWIG_LUA_CONSTTAB_INT("SIGNATURE_DATA", (SIGNATURE_DATA))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE", (UPDATE_MODULE))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE_NAME", (UPDATE_MODULE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE_STREAM", (UPDATE_MODULE_STREAM))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE_VERSION", (UPDATE_MODULE_VERSION))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE_CONTEXT", (UPDATE_MODULE_CONTEXT))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_MODULE_ARCH", (UPDATE_MODULE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_BUILDVERSION", (SOLVABLE_BUILDVERSION))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_BUILDFLAVOR", (SOLVABLE_BUILDFLAVOR))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_STATUS", (UPDATE_STATUS))},
    {SWIG_LUA_CONSTTAB_INT("LIBSOLV_SELF_DESTRUCT_PKG", (LIBSOLV_SELF_DESTRUCT_PKG))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_CONSTRAINS", (SOLVABLE_CONSTRAINS))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_TRACK_FEATURES", (SOLVABLE_TRACK_FEATURES))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ISDEFAULT", (SOLVABLE_ISDEFAULT))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_LANGONLY", (SOLVABLE_LANGONLY))},
    {SWIG_LUA_CONSTTAB_INT("UPDATE_COLLECTIONLIST", (UPDATE_COLLECTIONLIST))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_MULTIARCH", (SOLVABLE_MULTIARCH))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_SIGNATUREDATA", (SOLVABLE_SIGNATUREDATA))},
    {SWIG_LUA_CONSTTAB_INT("SOLVABLE_ORDERWITHREQUIRES", (SOLVABLE_ORDERWITHREQUIRES))},
    {SWIG_LUA_CONSTTAB_INT("ID_NUM_INTERNAL", (ID_NUM_INTERNAL))},
    {SWIG_LUA_CONSTTAB_INT("SOLVID_META", (SOLVID_META))},
    {SWIG_LUA_CONSTTAB_INT("SOLVID_POS", (SOLVID_POS))},
    {SWIG_LUA_CONSTTAB_INT("REL_EQ", (REL_EQ))},
    {SWIG_LUA_CONSTTAB_INT("REL_GT", (REL_GT))},
    {SWIG_LUA_CONSTTAB_INT("REL_LT", (REL_LT))},
    {SWIG_LUA_CONSTTAB_INT("REL_AND", (REL_AND))},
    {SWIG_LUA_CONSTTAB_INT("REL_OR", (REL_OR))},
    {SWIG_LUA_CONSTTAB_INT("REL_WITH", (REL_WITH))},
    {SWIG_LUA_CONSTTAB_INT("REL_NAMESPACE", (REL_NAMESPACE))},
    {SWIG_LUA_CONSTTAB_INT("REL_ARCH", (REL_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("REL_FILECONFLICT", (REL_FILECONFLICT))},
    {SWIG_LUA_CONSTTAB_INT("REL_COND", (REL_COND))},
    {SWIG_LUA_CONSTTAB_INT("REL_COMPAT", (REL_COMPAT))},
    {SWIG_LUA_CONSTTAB_INT("REL_KIND", (REL_KIND))},
    {SWIG_LUA_CONSTTAB_INT("REL_MULTIARCH", (REL_MULTIARCH))},
    {SWIG_LUA_CONSTTAB_INT("REL_ELSE", (REL_ELSE))},
    {SWIG_LUA_CONSTTAB_INT("REL_ERROR", (REL_ERROR))},
    {SWIG_LUA_CONSTTAB_INT("REL_WITHOUT", (REL_WITHOUT))},
    {SWIG_LUA_CONSTTAB_INT("REL_UNLESS", (REL_UNLESS))},
    {SWIG_LUA_CONSTTAB_INT("REL_CONDA", (REL_CONDA))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_NAME", (SELECTION_NAME))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_PROVIDES", (SELECTION_PROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_FILELIST", (SELECTION_FILELIST))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_CANON", (SELECTION_CANON))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_DOTARCH", (SELECTION_DOTARCH))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_REL", (SELECTION_REL))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_INSTALLED_ONLY", (SELECTION_INSTALLED_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_GLOB", (SELECTION_GLOB))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_FLAT", (SELECTION_FLAT))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_NOCASE", (SELECTION_NOCASE))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_SKIP_KIND", (SELECTION_SKIP_KIND))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_MATCH_DEPSTR", (SELECTION_MATCH_DEPSTR))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_SOURCE_ONLY", (SELECTION_SOURCE_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_WITH_SOURCE", (SELECTION_WITH_SOURCE))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_WITH_DISABLED", (SELECTION_WITH_DISABLED))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_WITH_BADARCH", (SELECTION_WITH_BADARCH))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_WITH_ALL", (SELECTION_WITH_ALL))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_ADD", (SELECTION_ADD))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_SUBTRACT", (SELECTION_SUBTRACT))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_FILTER", (SELECTION_FILTER))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_FILTER_KEEP_IFEMPTY", (SELECTION_FILTER_KEEP_IFEMPTY))},
    {SWIG_LUA_CONSTTAB_INT("Selection_SELECTION_FILTER_SWAPPED", (SELECTION_FILTER_SWAPPED))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_STRING", (SEARCH_STRING))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_STRINGSTART", (SEARCH_STRINGSTART))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_STRINGEND", (SEARCH_STRINGEND))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_SUBSTRING", (SEARCH_SUBSTRING))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_GLOB", (SEARCH_GLOB))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_REGEX", (SEARCH_REGEX))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_NOCASE", (SEARCH_NOCASE))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_FILES", (SEARCH_FILES))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_COMPLETE_FILELIST", (SEARCH_COMPLETE_FILELIST))},
    {SWIG_LUA_CONSTTAB_INT("Dataiterator_SEARCH_CHECKSUMS", (SEARCH_CHECKSUMS))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE", (SOLVER_SOLVABLE))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE_NAME", (SOLVER_SOLVABLE_NAME))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE_PROVIDES", (SOLVER_SOLVABLE_PROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE_ONE_OF", (SOLVER_SOLVABLE_ONE_OF))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE_REPO", (SOLVER_SOLVABLE_REPO))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SOLVABLE_ALL", (SOLVER_SOLVABLE_ALL))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SELECTMASK", (SOLVER_SELECTMASK))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_NOOP", (SOLVER_NOOP))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_INSTALL", (SOLVER_INSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_ERASE", (SOLVER_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_UPDATE", (SOLVER_UPDATE))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_WEAKENDEPS", (SOLVER_WEAKENDEPS))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_MULTIVERSION", (SOLVER_MULTIVERSION))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_LOCK", (SOLVER_LOCK))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_DISTUPGRADE", (SOLVER_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_VERIFY", (SOLVER_VERIFY))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_DROP_ORPHANED", (SOLVER_DROP_ORPHANED))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_USERINSTALLED", (SOLVER_USERINSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_ALLOWUNINSTALL", (SOLVER_ALLOWUNINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_FAVOR", (SOLVER_FAVOR))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_DISFAVOR", (SOLVER_DISFAVOR))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_EXCLUDEFROMWEAK", (SOLVER_EXCLUDEFROMWEAK))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_JOBMASK", (SOLVER_JOBMASK))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_WEAK", (SOLVER_WEAK))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_ESSENTIAL", (SOLVER_ESSENTIAL))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_CLEANDEPS", (SOLVER_CLEANDEPS))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_FORCEBEST", (SOLVER_FORCEBEST))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_TARGETED", (SOLVER_TARGETED))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_NOTBYUSER", (SOLVER_NOTBYUSER))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETEV", (SOLVER_SETEV))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETEVR", (SOLVER_SETEVR))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETARCH", (SOLVER_SETARCH))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETVENDOR", (SOLVER_SETVENDOR))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETREPO", (SOLVER_SETREPO))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETNAME", (SOLVER_SETNAME))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_NOAUTOSET", (SOLVER_NOAUTOSET))},
    {SWIG_LUA_CONSTTAB_INT("Job_SOLVER_SETMASK", (SOLVER_SETMASK))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_PROMOTEEPOCH", (POOL_FLAG_PROMOTEEPOCH))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_FORBIDSELFCONFLICTS", (POOL_FLAG_FORBIDSELFCONFLICTS))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_OBSOLETEUSESPROVIDES", (POOL_FLAG_OBSOLETEUSESPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES", (POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_OBSOLETEUSESCOLORS", (POOL_FLAG_OBSOLETEUSESCOLORS))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS", (POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_NOINSTALLEDOBSOLETES", (POOL_FLAG_NOINSTALLEDOBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_HAVEDISTEPOCH", (POOL_FLAG_HAVEDISTEPOCH))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_NOOBSOLETESMULTIVERSION", (POOL_FLAG_NOOBSOLETESMULTIVERSION))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_ADDFILEPROVIDESFILTERED", (POOL_FLAG_ADDFILEPROVIDESFILTERED))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_NOWHATPROVIDESAUX", (POOL_FLAG_NOWHATPROVIDESAUX))},
    {SWIG_LUA_CONSTTAB_INT("Pool_POOL_FLAG_WHATPROVIDESWITHDISABLED", (POOL_FLAG_WHATPROVIDESWITHDISABLED))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_RPM", (DISTTYPE_RPM))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_DEB", (DISTTYPE_DEB))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_ARCH", (DISTTYPE_ARCH))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_HAIKU", (DISTTYPE_HAIKU))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_CONDA", (DISTTYPE_CONDA))},
    {SWIG_LUA_CONSTTAB_INT("Pool_DISTTYPE_APK", (DISTTYPE_APK))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_REUSE_REPODATA", (REPO_REUSE_REPODATA))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_NO_INTERNALIZE", (REPO_NO_INTERNALIZE))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_LOCALPOOL", (REPO_LOCALPOOL))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_USE_LOADING", (REPO_USE_LOADING))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_EXTEND_SOLVABLES", (REPO_EXTEND_SOLVABLES))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_USE_ROOTDIR", (REPO_USE_ROOTDIR))},
    {SWIG_LUA_CONSTTAB_INT("Repo_REPO_NO_LOCATION", (REPO_NO_LOCATION))},
    {SWIG_LUA_CONSTTAB_INT("Repo_SOLV_ADD_NO_STUBS", (SOLV_ADD_NO_STUBS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_UNKNOWN", (SOLVER_RULE_UNKNOWN))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG", (SOLVER_RULE_PKG))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_NOT_INSTALLABLE", (SOLVER_RULE_PKG_NOT_INSTALLABLE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP", (SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_REQUIRES", (SOLVER_RULE_PKG_REQUIRES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_SELF_CONFLICT", (SOLVER_RULE_PKG_SELF_CONFLICT))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_CONFLICTS", (SOLVER_RULE_PKG_CONFLICTS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_SAME_NAME", (SOLVER_RULE_PKG_SAME_NAME))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_OBSOLETES", (SOLVER_RULE_PKG_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_IMPLICIT_OBSOLETES", (SOLVER_RULE_PKG_IMPLICIT_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_INSTALLED_OBSOLETES", (SOLVER_RULE_PKG_INSTALLED_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_RECOMMENDS", (SOLVER_RULE_PKG_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_CONSTRAINS", (SOLVER_RULE_PKG_CONSTRAINS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_PKG_SUPPLEMENTS", (SOLVER_RULE_PKG_SUPPLEMENTS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_UPDATE", (SOLVER_RULE_UPDATE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_FEATURE", (SOLVER_RULE_FEATURE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_JOB", (SOLVER_RULE_JOB))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP", (SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM", (SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_JOB_UNKNOWN_PACKAGE", (SOLVER_RULE_JOB_UNKNOWN_PACKAGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_JOB_UNSUPPORTED", (SOLVER_RULE_JOB_UNSUPPORTED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_DISTUPGRADE", (SOLVER_RULE_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_INFARCH", (SOLVER_RULE_INFARCH))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_CHOICE", (SOLVER_RULE_CHOICE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_LEARNT", (SOLVER_RULE_LEARNT))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_BEST", (SOLVER_RULE_BEST))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_YUMOBS", (SOLVER_RULE_YUMOBS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_RECOMMENDS", (SOLVER_RULE_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_BLACK", (SOLVER_RULE_BLACK))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_STRICT_REPO_PRIORITY", (SOLVER_RULE_STRICT_REPO_PRIORITY))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_JOB", (SOLVER_SOLUTION_JOB))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_POOLJOB", (SOLVER_SOLUTION_POOLJOB))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_INFARCH", (SOLVER_SOLUTION_INFARCH))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_DISTUPGRADE", (SOLVER_SOLUTION_DISTUPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_BEST", (SOLVER_SOLUTION_BEST))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_ERASE", (SOLVER_SOLUTION_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_REPLACE", (SOLVER_SOLUTION_REPLACE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_REPLACE_DOWNGRADE", (SOLVER_SOLUTION_REPLACE_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_REPLACE_ARCHCHANGE", (SOLVER_SOLUTION_REPLACE_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_REPLACE_VENDORCHANGE", (SOLVER_SOLUTION_REPLACE_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_SOLUTION_REPLACE_NAMECHANGE", (SOLVER_SOLUTION_REPLACE_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_POLICY_ILLEGAL_DOWNGRADE", (POLICY_ILLEGAL_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_POLICY_ILLEGAL_ARCHCHANGE", (POLICY_ILLEGAL_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_POLICY_ILLEGAL_VENDORCHANGE", (POLICY_ILLEGAL_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_POLICY_ILLEGAL_NAMECHANGE", (POLICY_ILLEGAL_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ALLOW_DOWNGRADE", (SOLVER_FLAG_ALLOW_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ALLOW_ARCHCHANGE", (SOLVER_FLAG_ALLOW_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ALLOW_VENDORCHANGE", (SOLVER_FLAG_ALLOW_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ALLOW_NAMECHANGE", (SOLVER_FLAG_ALLOW_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ALLOW_UNINSTALL", (SOLVER_FLAG_ALLOW_UNINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_NO_UPDATEPROVIDE", (SOLVER_FLAG_NO_UPDATEPROVIDE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_SPLITPROVIDES", (SOLVER_FLAG_SPLITPROVIDES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_IGNORE_RECOMMENDED", (SOLVER_FLAG_IGNORE_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ADD_ALREADY_RECOMMENDED", (SOLVER_FLAG_ADD_ALREADY_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_NO_INFARCHCHECK", (SOLVER_FLAG_NO_INFARCHCHECK))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_BEST_OBEY_POLICY", (SOLVER_FLAG_BEST_OBEY_POLICY))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_NO_AUTOTARGET", (SOLVER_FLAG_NO_AUTOTARGET))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_DUP_ALLOW_DOWNGRADE", (SOLVER_FLAG_DUP_ALLOW_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE", (SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE", (SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_DUP_ALLOW_NAMECHANGE", (SOLVER_FLAG_DUP_ALLOW_NAMECHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_KEEP_ORPHANS", (SOLVER_FLAG_KEEP_ORPHANS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_BREAK_ORPHANS", (SOLVER_FLAG_BREAK_ORPHANS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_FOCUS_INSTALLED", (SOLVER_FLAG_FOCUS_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_YUM_OBSOLETES", (SOLVER_FLAG_YUM_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_NEED_UPDATEPROVIDE", (SOLVER_FLAG_NEED_UPDATEPROVIDE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_FOCUS_BEST", (SOLVER_FLAG_FOCUS_BEST))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_STRONG_RECOMMENDS", (SOLVER_FLAG_STRONG_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_INSTALL_ALSO_UPDATES", (SOLVER_FLAG_INSTALL_ALSO_UPDATES))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED", (SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_STRICT_REPO_PRIORITY", (SOLVER_FLAG_STRICT_REPO_PRIORITY))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_FLAG_FOCUS_NEW", (SOLVER_FLAG_FOCUS_NEW))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_UNRELATED", (SOLVER_REASON_UNRELATED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_UNIT_RULE", (SOLVER_REASON_UNIT_RULE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_KEEP_INSTALLED", (SOLVER_REASON_KEEP_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_RESOLVE_JOB", (SOLVER_REASON_RESOLVE_JOB))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_UPDATE_INSTALLED", (SOLVER_REASON_UPDATE_INSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_CLEANDEPS_ERASE", (SOLVER_REASON_CLEANDEPS_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_RESOLVE", (SOLVER_REASON_RESOLVE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_WEAKDEP", (SOLVER_REASON_WEAKDEP))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_RESOLVE_ORPHAN", (SOLVER_REASON_RESOLVE_ORPHAN))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_RECOMMENDED", (SOLVER_REASON_RECOMMENDED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_SUPPLEMENTED", (SOLVER_REASON_SUPPLEMENTED))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_UNSOLVABLE", (SOLVER_REASON_UNSOLVABLE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_REASON_PREMISE", (SOLVER_REASON_PREMISE))},
    {SWIG_LUA_CONSTTAB_INT("Solver_SOLVER_RULE_RPM", (SOLVER_RULE_RPM))},
    {SWIG_LUA_CONSTTAB_INT("Alternative_SOLVER_ALTERNATIVE_TYPE_RULE", (SOLVER_ALTERNATIVE_TYPE_RULE))},
    {SWIG_LUA_CONSTTAB_INT("Alternative_SOLVER_ALTERNATIVE_TYPE_RECOMMENDS", (SOLVER_ALTERNATIVE_TYPE_RECOMMENDS))},
    {SWIG_LUA_CONSTTAB_INT("Alternative_SOLVER_ALTERNATIVE_TYPE_SUGGESTS", (SOLVER_ALTERNATIVE_TYPE_SUGGESTS))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_IGNORE", (SOLVER_TRANSACTION_IGNORE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_ERASE", (SOLVER_TRANSACTION_ERASE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_REINSTALLED", (SOLVER_TRANSACTION_REINSTALLED))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_DOWNGRADED", (SOLVER_TRANSACTION_DOWNGRADED))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_CHANGED", (SOLVER_TRANSACTION_CHANGED))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_UPGRADED", (SOLVER_TRANSACTION_UPGRADED))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_OBSOLETED", (SOLVER_TRANSACTION_OBSOLETED))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_INSTALL", (SOLVER_TRANSACTION_INSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_REINSTALL", (SOLVER_TRANSACTION_REINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_DOWNGRADE", (SOLVER_TRANSACTION_DOWNGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_CHANGE", (SOLVER_TRANSACTION_CHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_UPGRADE", (SOLVER_TRANSACTION_UPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_OBSOLETES", (SOLVER_TRANSACTION_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_MULTIINSTALL", (SOLVER_TRANSACTION_MULTIINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_MULTIREINSTALL", (SOLVER_TRANSACTION_MULTIREINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_MAXTYPE", (SOLVER_TRANSACTION_MAXTYPE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_SHOW_ACTIVE", (SOLVER_TRANSACTION_SHOW_ACTIVE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_SHOW_ALL", (SOLVER_TRANSACTION_SHOW_ALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_SHOW_OBSOLETES", (SOLVER_TRANSACTION_SHOW_OBSOLETES))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_SHOW_MULTIINSTALL", (SOLVER_TRANSACTION_SHOW_MULTIINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_CHANGE_IS_REINSTALL", (SOLVER_TRANSACTION_CHANGE_IS_REINSTALL))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE", (SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_MERGE_VENDORCHANGES", (SOLVER_TRANSACTION_MERGE_VENDORCHANGES))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_MERGE_ARCHCHANGES", (SOLVER_TRANSACTION_MERGE_ARCHCHANGES))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_RPM_ONLY", (SOLVER_TRANSACTION_RPM_ONLY))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_ARCHCHANGE", (SOLVER_TRANSACTION_ARCHCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_VENDORCHANGE", (SOLVER_TRANSACTION_VENDORCHANGE))},
    {SWIG_LUA_CONSTTAB_INT("Transaction_SOLVER_TRANSACTION_KEEP_ORDERDATA", (SOLVER_TRANSACTION_KEEP_ORDERDATA))},
    {0,0,0,0,0,0}
};
static swig_lua_method swig_SwigModule_methods[]= {
    { "Chksum_from_bin", _wrap_Chksum_from_bin},
    { "xfopen", _wrap_xfopen},
    { "xfopen_fd", _wrap_xfopen_fd},
    {0,0}
};
static swig_lua_class* swig_SwigModule_classes[]= {
&_wrap_class_Selection,
&_wrap_class_Dep,
&_wrap_class_Dataiterator,
&_wrap_class_XSolvable,
&_wrap_class_Ruleinfo,
&_wrap_class_XRule,
&_wrap_class_XRepodata,
&_wrap_class_Pool_solvable_iterator,
&_wrap_class_Pool_repo_iterator,
&_wrap_class_Repo_solvable_iterator,
&_wrap_class_Datamatch,
&_wrap_class_Datapos,
&_wrap_class_Job,
&_wrap_class_Pool,
&_wrap_class_Repo,
&_wrap_class_Decision,
&_wrap_class_Decisionset,
&_wrap_class_Solver,
&_wrap_class_Chksum,
&_wrap_class_SolvFp,
&_wrap_class_Problem,
&_wrap_class_Solution,
&_wrap_class_Solutionelement,
&_wrap_class_Alternative,
&_wrap_class_Transaction,
&_wrap_class_TransactionClass,
    0
};
static swig_lua_namespace* swig_SwigModule_namespaces[] = {
    0
};

static swig_lua_namespace swig_SwigModule = {
    "solv",
    swig_SwigModule_methods,
    swig_SwigModule_attributes,
    swig_SwigModule_constants,
    swig_SwigModule_classes,
    swig_SwigModule_namespaces
};
#ifdef __cplusplus
}
#endif

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

static swig_type_info _swigt__p_Alternative = {"_p_Alternative", "Alternative *", 0, 0, (void*)&_wrap_class_Alternative, 0};
static swig_type_info _swigt__p_Chksum = {"_p_Chksum", "Chksum *", 0, 0, (void*)&_wrap_class_Chksum, 0};
static swig_type_info _swigt__p_Dataiterator = {"_p_Dataiterator", "Dataiterator *", 0, 0, (void*)&_wrap_class_Dataiterator, 0};
static swig_type_info _swigt__p_Datamatch = {"_p_Datamatch", "Datamatch *", 0, 0, (void*)&_wrap_class_Datamatch, 0};
static swig_type_info _swigt__p_Datapos = {"_p_Datapos", "Datapos *", 0, 0, (void*)&_wrap_class_Datapos, 0};
static swig_type_info _swigt__p_Decision = {"_p_Decision", "Decision *", 0, 0, (void*)&_wrap_class_Decision, 0};
static swig_type_info _swigt__p_Decisionset = {"_p_Decisionset", "Decisionset *", 0, 0, (void*)&_wrap_class_Decisionset, 0};
static swig_type_info _swigt__p_Dep = {"_p_Dep", "Dep *", 0, 0, (void*)&_wrap_class_Dep, 0};
static swig_type_info _swigt__p_Job = {"_p_Job", "Job *", 0, 0, (void*)&_wrap_class_Job, 0};
static swig_type_info _swigt__p_Pool = {"_p_Pool", "Pool *", 0, 0, (void*)&_wrap_class_Pool, 0};
static swig_type_info _swigt__p_Pool_repo_iterator = {"_p_Pool_repo_iterator", "Pool_repo_iterator *", 0, 0, (void*)&_wrap_class_Pool_repo_iterator, 0};
static swig_type_info _swigt__p_Pool_solvable_iterator = {"_p_Pool_solvable_iterator", "Pool_solvable_iterator *", 0, 0, (void*)&_wrap_class_Pool_solvable_iterator, 0};
static swig_type_info _swigt__p_Problem = {"_p_Problem", "Problem *", 0, 0, (void*)&_wrap_class_Problem, 0};
static swig_type_info _swigt__p_Queue = {"_p_Queue", "Queue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Repo = {"_p_Repo", "Repo *", 0, 0, (void*)&_wrap_class_Repo, 0};
static swig_type_info _swigt__p_Repo_solvable_iterator = {"_p_Repo_solvable_iterator", "Repo_solvable_iterator *", 0, 0, (void*)&_wrap_class_Repo_solvable_iterator, 0};
static swig_type_info _swigt__p_Ruleinfo = {"_p_Ruleinfo", "Ruleinfo *", 0, 0, (void*)&_wrap_class_Ruleinfo, 0};
static swig_type_info _swigt__p_Selection = {"_p_Selection", "Selection *", 0, 0, (void*)&_wrap_class_Selection, 0};
static swig_type_info _swigt__p_Solution = {"_p_Solution", "Solution *", 0, 0, (void*)&_wrap_class_Solution, 0};
static swig_type_info _swigt__p_Solutionelement = {"_p_Solutionelement", "Solutionelement *", 0, 0, (void*)&_wrap_class_Solutionelement, 0};
static swig_type_info _swigt__p_SolvFp = {"_p_SolvFp", "SolvFp *", 0, 0, (void*)&_wrap_class_SolvFp, 0};
static swig_type_info _swigt__p_Solver = {"_p_Solver", "Solver *", 0, 0, (void*)&_wrap_class_Solver, 0};
static swig_type_info _swigt__p_Transaction = {"_p_Transaction", "Transaction *", 0, 0, (void*)&_wrap_class_Transaction, 0};
static swig_type_info _swigt__p_TransactionClass = {"_p_TransactionClass", "TransactionClass *", 0, 0, (void*)&_wrap_class_TransactionClass, 0};
static swig_type_info _swigt__p_XRepodata = {"_p_XRepodata", "XRepodata *", 0, 0, (void*)&_wrap_class_XRepodata, 0};
static swig_type_info _swigt__p_XRule = {"_p_XRule", "XRule *", 0, 0, (void*)&_wrap_class_XRule, 0};
static swig_type_info _swigt__p_XSolvable = {"_p_XSolvable", "XSolvable *", 0, 0, (void*)&_wrap_class_XSolvable, 0};
static swig_type_info _swigt__p_int = {"_p_int", "Id *|int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_XRule = {"_p_p_XRule", "XRule **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_Alternative,
  &_swigt__p_Chksum,
  &_swigt__p_Dataiterator,
  &_swigt__p_Datamatch,
  &_swigt__p_Datapos,
  &_swigt__p_Decision,
  &_swigt__p_Decisionset,
  &_swigt__p_Dep,
  &_swigt__p_Job,
  &_swigt__p_Pool,
  &_swigt__p_Pool_repo_iterator,
  &_swigt__p_Pool_solvable_iterator,
  &_swigt__p_Problem,
  &_swigt__p_Queue,
  &_swigt__p_Repo,
  &_swigt__p_Repo_solvable_iterator,
  &_swigt__p_Ruleinfo,
  &_swigt__p_Selection,
  &_swigt__p_Solution,
  &_swigt__p_Solutionelement,
  &_swigt__p_SolvFp,
  &_swigt__p_Solver,
  &_swigt__p_Transaction,
  &_swigt__p_TransactionClass,
  &_swigt__p_XRepodata,
  &_swigt__p_XRule,
  &_swigt__p_XSolvable,
  &_swigt__p_int,
  &_swigt__p_lua_State,
  &_swigt__p_p_XRule,
  &_swigt__p_unsigned_char,
  &_swigt__p_unsigned_int,
};

static swig_cast_info _swigc__p_Alternative[] = {  {&_swigt__p_Alternative, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Chksum[] = {  {&_swigt__p_Chksum, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Dataiterator[] = {  {&_swigt__p_Dataiterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Datamatch[] = {  {&_swigt__p_Datamatch, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Datapos[] = {  {&_swigt__p_Datapos, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Decision[] = {  {&_swigt__p_Decision, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Decisionset[] = {  {&_swigt__p_Decisionset, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Dep[] = {  {&_swigt__p_Dep, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Job[] = {  {&_swigt__p_Job, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Pool[] = {  {&_swigt__p_Pool, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Pool_repo_iterator[] = {  {&_swigt__p_Pool_repo_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Pool_solvable_iterator[] = {  {&_swigt__p_Pool_solvable_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Problem[] = {  {&_swigt__p_Problem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Queue[] = {  {&_swigt__p_Queue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Repo[] = {  {&_swigt__p_Repo, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Repo_solvable_iterator[] = {  {&_swigt__p_Repo_solvable_iterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Ruleinfo[] = {  {&_swigt__p_Ruleinfo, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Selection[] = {  {&_swigt__p_Selection, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Solution[] = {  {&_swigt__p_Solution, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Solutionelement[] = {  {&_swigt__p_Solutionelement, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_SolvFp[] = {  {&_swigt__p_SolvFp, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Solver[] = {  {&_swigt__p_Solver, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Transaction[] = {  {&_swigt__p_Transaction, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_TransactionClass[] = {  {&_swigt__p_TransactionClass, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_XRepodata[] = {  {&_swigt__p_XRepodata, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_XRule[] = {  {&_swigt__p_XRule, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_XSolvable[] = {  {&_swigt__p_XSolvable, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lua_State[] = {  {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_XRule[] = {  {&_swigt__p_p_XRule, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_Alternative,
  _swigc__p_Chksum,
  _swigc__p_Dataiterator,
  _swigc__p_Datamatch,
  _swigc__p_Datapos,
  _swigc__p_Decision,
  _swigc__p_Decisionset,
  _swigc__p_Dep,
  _swigc__p_Job,
  _swigc__p_Pool,
  _swigc__p_Pool_repo_iterator,
  _swigc__p_Pool_solvable_iterator,
  _swigc__p_Problem,
  _swigc__p_Queue,
  _swigc__p_Repo,
  _swigc__p_Repo_solvable_iterator,
  _swigc__p_Ruleinfo,
  _swigc__p_Selection,
  _swigc__p_Solution,
  _swigc__p_Solutionelement,
  _swigc__p_SolvFp,
  _swigc__p_Solver,
  _swigc__p_Transaction,
  _swigc__p_TransactionClass,
  _swigc__p_XRepodata,
  _swigc__p_XRule,
  _swigc__p_XSolvable,
  _swigc__p_int,
  _swigc__p_lua_State,
  _swigc__p_p_XRule,
  _swigc__p_unsigned_char,
  _swigc__p_unsigned_int,
};


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

/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is made tough by the requirement that no dynamic
 * memory is used. Also, since swig_type_info structures store pointers to
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization.
 * The idea is that swig generates all the structures that are needed.
 * The runtime then collects these partially filled structures.
 * The SWIG_InitializeModule function takes these initial arrays out of
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned statically to an initial
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast dependencies. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns.
 *
 * We loop through the cast[] array associated with the type and mark casts
 * which have not been defined in previously loaded modules by assigning
 * cast pointer value to cast->next. We also hash cast->type->name string
 * and store the value in the cast->value field. If we encounter swig_cast_info
 * structure that represents a cast to self we move it to the beginning
 * of the cast array. One trick we need to do is making sure the type pointer
 * in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded.
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the list (because the cast->type) pointer will
 *     be correct.
 *
 * Once the cast array has been set up AND it does have new casts that need
 * to be added we sort non-self cast entries to move filtered out entries
 * to the end of the array and to arrange the rest in the increasing order
 * of their type pointer values. We store the index of the last added entry
 * in the cast->value field of the entry[0] (overwriting the name hash). Then
 * we sort <next|value> fields of the remaining entries to arrange hash values
 * in the increasing order. This way cast->next->type->name field matches
 * the cast->value hash.
 *
 * Example:
 * Array of casts for type stored at 0x5000, cast to type stored at 0x3000
 * has already been loaded
 *
 *      After sweep-and-hash:   After sort-by-type:    After sort-by-hash:
 *        ________________       ________________       ________________
 *       |                |     |                |     |                |
 * Entry |  type = 0x5000 |     |  type = 0x5000 |     |  type = 0x5000 |
 *   0   |                |     |                |     |                |
 *       |  next = Entry0 |     |  next = Entry0 |     |  next = Entry0 |
 *       | value = 1212   |     | value = 3      |     | value = 3      |
 *       |                |     |                |     |                |
 *       |================|     |================|     |================|
 *       |                |     |                |     |                |
 * Entry |  type = 0x2000 |     |  type = 0x1000 |     |  type = 0x1000 |
 *   1   |                |     |                |     |                |
 *       |  next = Entry1 |     |  next = Entry1 |     |  next = Entry3 |
 *       | value = 3434   |     | value = 4545   |     | value = 2323   |
 *       |________________|     |________________|     |________________|
 *       |                |     |                |     |                |
 * Entry |  type = 0x3000 |     |  type = 0x2000 |     |  type = 0x2000 |
 *   2   |                |     |                |     |                |
 *       |  next = 0      |     |  next = Entry2 |     |  next = Entry2 |
 *       | value = 0      |     | value = 3434   |     | value = 3434   |
 *       |________________|     |________________|     |________________|
 *       |                |     |                |     |                |
 * Entry |  type = 0x1000 |     |  type = 0x4000 |     |  type = 0x4000 |
 *   3   |                |     |                |     |                |
 *       |  next = Entry3 |     |  next = Entry3 |     |  next = Entry1 |
 *       | value = 4545   |     | value = 2323   |     | value = 4545   |
 *       |________________|     |________________|     |________________|
 *       |                |     |                |     |                |
 * Entry |  type = 0x4000 |     |  type = 0x3000 |     |  type = 0x3000 |
 *   4   |                |     |                |     |                |
 *       |  next = Entry4 |     |  next = 0      |     |  next = 0      |
 *       | value = 2323   |     | value = 0      |     | value = 0      |
 *       |________________|     |________________|     |________________|
 *
 * Once the cast array has been initialized, we use cast[0]->next field to link
 * it into the list of cast arrays for the type.
 *              ____    ____    ____
 * type->cast->|next|->|next|->|next|->0
 *             |----|  |----|  |----|
 *             |----|  |----|  |----|
 *             |----|  |----|  |----|
 *
 * Subsequent cast resolution works as follows:
 *
 * 1. Check whether the type matches the first entry in the current cast array.
 * 2. If not, then do a binary search over the (0:cast->value] interval using
 *    either type address or the hash value of the type name.
 * 3. If not found, then move over to the next cast array (cast[0]->next).
 *
 * ----------------------------------------------------------------------------- */

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

#if 0
#define SWIGRUNTIME_DEBUG
#endif

#ifndef SWIG_INIT_CLIENT_DATA_TYPE
#define SWIG_INIT_CLIENT_DATA_TYPE void *
#endif

/*
 * Sort function that puts cast entries with nonzero 'next' at the front
 * of the array while ordering them by addresses of their 'type' structs.
 */
SWIGINTERN int SWIG_CastCmpStruct(const void *pa, const void *pb) {
  swig_cast_info *pca = (swig_cast_info *)pa;
  swig_cast_info *pcb = (swig_cast_info *)pb;
  if (pca->type < pcb->type)
    return (pca->next || pcb->next == 0) ? -1 : 1;
  if (pca->type > pcb->type)
    return (pcb->next || pca->next == 0) ? 1 : -1;
  return 0;
}

/*
 * Shell-sort 'next' and 'value' field pairs to order them by 'value'.
 */
SWIGINTERN void SWIG_CastHashSort(swig_cast_info *cast, int size) {
  const int hmax = size/9;
  int h, i;
  for(h = 1; h <= hmax; h = 3*h+1);
  for(; h > 0; h /= 3)
  {
    for(i = h; i < size; ++i)
    {
      swig_cast_info *p = cast[i].next;
      unsigned int hash = cast[i].value;
      int j = i;
      while(j >= h && hash < cast[j-h].value)
      {
        cast[j].next = cast[j-h].next;
        cast[j].value = cast[j-h].value;
        j -= h;
      }
      cast[j].next = p;
      cast[j].value = hash;
    }
  }
}

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

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

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpreters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *target_type;
    swig_cast_info *cast, *first;
    int num_mapped = 0;

#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
#endif

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

    /* Insert casting types */
    cast = first = swig_module.cast_initial[i];
    while (cast->type) {

      /* Don't need to add information already in the list */
      target_type = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        target_type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
        if (target_type) {

          /* Target type already defined in another module */
#ifdef SWIGRUNTIME_DEBUG
          printf("SWIG_InitializeModule: found cast %s\n", target_type->name);
#endif
          if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
            printf("SWIG_InitializeModule: skip old type %s\n", target_type->name);
#endif
            cast->type = target_type;
            target_type = 0;
          } else {
            /* Check if this cast is already in the list */
            swig_cast_info *ocast = SWIG_TypeCheck(target_type->name, type);
#ifdef SWIGRUNTIME_DEBUG
            if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", target_type->name);
#endif
            if (!ocast) target_type = 0;
          }
        }
      }

      if (!target_type) {
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        /* Set inclusion mark for sorting */
        cast->next = cast;
        num_mapped++;

        if (type == cast->type) {
#ifdef SWIGRUNTIME_DEBUG
          printf("%s : self cast at pos [%li]\n", type->name, cast - first);
#endif
          if (cast - first) {

            /* Move cast to itself to the first entry in the array */

            swig_cast_info tmp = *cast;
            *cast = *first;
            *first = tmp;
          }
          first++;

        } else {
          cast->value = SWIG_Hash(cast->type->name, (unsigned int)strlen(cast->type->name));
        }
      }
      cast++;
    }

    if (num_mapped) {
      if (cast - first) {
        swig_cast_info *tmp;

        /* Sort casts by type address for binary search in SWIG_TypeCheckStruct */
        qsort(first, cast - first, sizeof(swig_cast_info), SWIG_CastCmpStruct);

        /* Remap back links for added entries */
        cast = swig_module.cast_initial[i] + num_mapped;
        for (tmp = first; tmp < cast; tmp++) {
          tmp->next = tmp;
        }
      }

      /* Set the value field of the first entry to the index of the last added entry */
      cast = swig_module.cast_initial[i];
      cast->value = num_mapped - 1;

      num_mapped -= (int)(first - cast);
      if (num_mapped > 1) {
        /* Sort <'next','value'> pairs by 'value' for binary search in SWIG_TypeCheck */

        SWIG_CastHashSort(first, num_mapped);
      }

      first = type->cast;
      if (first) {
        /* Link the current set into the list of cast arrays */
        cast->next = first->next;
        first->next = cast;
      } else {
        cast->next = 0;
        type->cast = cast;
      }
    }

    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

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

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

  if (init_run) return;
  init_run = 1;

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

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



/* Forward declaration of where the user's %init{} gets inserted */
void SWIG_init_user(lua_State* L );
    
#ifdef __cplusplus
extern "C" {
#endif
/* this is the initialization function
  added at the very end of the code
  the function is always called SWIG_init, but an earlier #define will rename it
*/
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
LUALIB_API int SWIG_init(lua_State* L)
#else
SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
#endif
{
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
  int i;
  int globalRegister = 0;
  /* start with global table */
  lua_pushglobaltable (L);
  /* SWIG's internal initialisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
#endif

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE)
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal);
#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* set up base class pointers (the hierarchy) */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
#ifdef SWIG_LUA_MODULE_GLOBAL
  globalRegister = 1;
#endif


#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
  SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister);
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
#endif

#if defined(SWIG_LUA_ELUA_EMULATE)
  lua_newtable(L);
  SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods);
  SWIG_Lua_elua_emulate_register_clear(L);
  if(globalRegister) {
    lua_pushstring(L,swig_SwigModule.name);
    lua_pushvalue(L,-2);
    lua_rawset(L,-4);
  }
#endif

#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  /* Note: We do not clean up the stack here (Lua will do this for us). At this
     point, we have the globals table and out module table on the stack. Returning
     one value makes the module table the result of the require command. */
  return 1;
#else
  return 0;
#endif
}

#ifdef __cplusplus
}
#endif


const char* SWIG_LUACODE=
  "";

void SWIG_init_user(lua_State* L)
{
  /* exec Lua code if applicable */
  SWIG_Lua_dostring(L,SWIG_LUACODE);
}

