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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#if defined(__cplusplus) && __cplusplus >=201103L
# define SWIG_NOEXCEPT noexcept
#else
# define SWIG_NOEXCEPT throw()
#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


#if __GNUC__ >= 7
#pragma GCC diagnostic push
#if defined(__cplusplus)
#pragma GCC diagnostic ignored "-Wregister"
#if __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wvolatile"
#if __GNUC__ >= 11
#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
#endif
#endif
#endif
#endif

#include <ruby.h>
#include <ruby/version.h> /* For RUBY_API_VERSION_CODE */

#if __GNUC__ >= 7
#pragma GCC diagnostic pop
#endif

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

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


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

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

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



/*
 * The following macros are used for providing the correct type of a
 * function pointer to the Ruby C API.
 *
 * Starting with Ruby 2.7 these macros act transparently due to Ruby's moving
 * moving away from ANYARGS and instead employing strict function signatures.
 *
 * Note: In case of C (not C++) the macros are transparent even before
 * Ruby 2.7 due to the fact that the Ruby C API used function declarators
 * with empty parentheses, which allows for an unspecified number of
 * arguments.
 *
 * PROTECTFUNC(f) is used for the function pointer argument of the Ruby
 * C API function rb_protect().
 *
 * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API
 * functions like rb_define_method() and rb_define_singleton_method().
 *
 * VOIDFUNC(f) is used to typecast a C function that implements either
 * the "mark" or "free" stuff for a Ruby Data object, so that it can be
 * passed as an argument to Ruby C API functions like Data_Wrap_Struct()
 * and Data_Make_Struct().
 *
 * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer
 * argument(s) of Ruby C API functions like rb_define_virtual_variable().
 *
 * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer
 * argument(s) of Ruby C API functions like st_foreach().
 */
#if defined(__cplusplus) && RUBY_API_VERSION_CODE < 20700
#  define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
#  define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
#  define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
#  define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f))
#  define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f))
#else
#  define PROTECTFUNC(f) (f)
#  define VALUEFUNC(f) (f)
#  define VOIDFUNC(f) (f)
#  define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
#  define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
#endif

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

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

static VALUE _mSWIG = Qnil;

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


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


/* Define custom exceptions for errors that do not map to existing Ruby
   exceptions. */

SWIGINTERN VALUE 
getNullReferenceError(void) {
  static VALUE rb_eNullReferenceError = Qnil;
  if (rb_eNullReferenceError == Qnil) {
    rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
  }
  return rb_eNullReferenceError;
} 

SWIGINTERN VALUE 
getObjectPreviouslyDeletedError(void) {
  static VALUE rb_eObjectPreviouslyDeleted = Qnil;
  if (rb_eObjectPreviouslyDeleted == Qnil) {
    rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
  }
  return rb_eObjectPreviouslyDeleted;
} 


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


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

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

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

  return StringValuePtr( str );
}

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
  return SWIG2NUM(swig_ruby_trackings->num_entries);
}


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

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

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

  rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
                             VALUEFUNC(swig_ruby_trackings_count),
                             SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
}

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

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

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

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

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

  if (object != Qnil) {
    // object might have the T_ZOMBIE type, but that's just
    // because the GC has flagged it as such for a deferred
    // destruction. Until then, it's still a T_DATA object.
    DATA_PTR(object) = 0;
  }
}

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

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

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

#ifdef __cplusplus
}
#endif

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

#ifdef __cplusplus
extern "C" {
#endif

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

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


#ifdef __cplusplus
}
#endif


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

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

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

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

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

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

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


/* Runtime API */

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


/* Error manipulation */

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


/* Ruby-specific SWIG API */

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

#include "assert.h"

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

#ifdef __cplusplus
extern "C" {
#endif

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


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

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

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

#ifdef RUBY_EMBEDDED

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

      static unsigned int swig_virtual_calls = 0;

#else  /* normal non-embedded extension */

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

#endif  /* RUBY_EMBEDDED */


SWIGRUNTIME VALUE 
getExceptionClass(void) {
  static VALUE rubyExceptionClass = Qnil;
  if (rubyExceptionClass == Qnil) {
    rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
  }
  return rubyExceptionClass;
} 

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

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

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

/* Create a new pointer object */
SWIGRUNTIME VALUE
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
{
  int own =  flags & SWIG_POINTER_OWN; 
  int track;
  char *klass_name;
  swig_class *sklass;
  VALUE klass;
  VALUE obj;

  if (!ptr)
    return Qnil;

  assert(type);
  if (type->clientdata) {
    sklass = (swig_class *) type->clientdata;
		
    /* Are we tracking this class and have we already returned this Ruby object? */
    track = sklass->trackObjects;
    if (track) {
      obj = SWIG_RubyInstanceFor(ptr);

      /* Check the object's type and make sure it has the correct type.
        It might not in cases where methods do things like 
        downcast methods. */
      if (obj != Qnil) {
        VALUE value = rb_iv_get(obj, "@__swigtype__");
        const char* type_name = RSTRING_PTR(value);
				
        if (strcmp(type->name, type_name) == 0) {
          return obj;
        }
      }
    }

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

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

  return obj;
}

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

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

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

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

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

  /* Grab the pointer */
  if (NIL_P(obj)) {
    if (ptr)
      *ptr = 0;
    return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
  } else {
    if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
      return SWIG_ERROR;
    }
    Data_Get_Struct(obj, void, vptr);
  }
  
  if (own) {
    own->datafree = RDATA(obj)->dfree;
    own->own = 0;
  }
    
  if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) {
    if (!RDATA(obj)->dfree)
      return SWIG_ERROR_RELEASE_NOT_OWNED;
  }

  /* Check to see if the input object is giving up ownership
     of the underlying C struct or C++ object.  If so then we
     need to reset the destructor since the Ruby object no 
     longer owns the underlying C++ object.*/ 
  if (flags & SWIG_POINTER_DISOWN) {
    /* Is tracking on for this class? */
    int track = 0;
    if (ty && ty->clientdata) {
      swig_class *sklass = (swig_class *) ty->clientdata;
      track = sklass->trackObjects;
    }

    if (track) {
      /* We are tracking objects for this class.  Thus we change the destructor
       * to SWIG_RubyRemoveTracking.  This allows us to
       * remove the mapping from the C++ to Ruby object
       * when the Ruby object is garbage collected.  If we don't
       * do this, then it is possible we will return a reference 
       * to a Ruby object that no longer exists thereby crashing Ruby. */
      RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
    } else {    
      RDATA(obj)->dfree = 0;
    }
  }

  if (flags & SWIG_POINTER_CLEAR) {
    DATA_PTR(obj) = 0;
  }

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

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

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

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

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

 type_error:
  return SWIG_ERROR;
}

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

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

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

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

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

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

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


#ifdef __cplusplus
}
#endif



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

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



/* -------- 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_Solvsig swig_types[22]
#define SWIGTYPE_p_Transaction swig_types[23]
#define SWIGTYPE_p_TransactionClass swig_types[24]
#define SWIGTYPE_p_XRepodata swig_types[25]
#define SWIGTYPE_p_XRule swig_types[26]
#define SWIGTYPE_p_XSolvable swig_types[27]
#define SWIGTYPE_p_char swig_types[28]
#define SWIGTYPE_p_int swig_types[29]
#define SWIGTYPE_p_p_XRule swig_types[30]
#define SWIGTYPE_p_p_void swig_types[31]
#define SWIGTYPE_p_unsigned_char swig_types[32]
#define SWIGTYPE_p_unsigned_int swig_types[33]
static swig_type_info *swig_types[35];
static swig_module_info swig_module = {swig_types, 34, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

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

#define SWIG_init    Init_solv
#define SWIG_name    "Solv"

static VALUE mSolv;

#define SWIG_RUBY_THREAD_BEGIN_BLOCK
#define SWIG_RUBY_THREAD_END_BLOCK


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


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


#ifdef __cplusplus
extern "C" {
#endif

/* Ruby 1.9 changed the file name of this header */
#ifdef HAVE_RUBY_IO_H
#include "ruby/io.h"
#else
#include "rubyio.h"
#endif

#ifdef __cplusplus
}
#endif


#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
struct timeval rb_time_timeval(VALUE);
#endif
#ifdef __cplusplus
}
#endif


#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) {
  *appdatap = 0;
}
SWIGINTERN void appdata_set_helper(void **appdatap, void *appdata) {
  *appdatap = appdata;
}
SWIGINTERN void *appdata_get_helper(void **appdatap) {
  return *appdatap;
}


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


  #define SWIG_From_long   LONG2NUM 


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

SWIGINTERN Selection *new_Selection(Pool *pool){
    Selection *s;
    s = solv_calloc(1, sizeof(*s));
    s->pool = pool;
    return s;
  }
SWIGINTERN bool Selection_isempty(Selection *self){
    return self->q.count == 0;
  }

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


SWIGINTERN VALUE
SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
{
  return Qnil;
} 


SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
{
  VALUE *args = (VALUE *)arg;
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  long *res = (long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
  return obj;
}

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


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

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 swig_type_info*
SWIG_pchar_descriptor(void)
{
  static swig_type_info* info = 0;
  if (!info) {
    info = SWIG_TypeQuery("_p_char");
  }
  return info;
}


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




SWIGINTERN 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(VALUE obj, int *val) {







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





  ecode = SWIG_AsVal_int(obj, val);

  if (SWIG_IsOK(ecode))
    return ecode;



  if ((SWIG_ConvertPtr(obj, &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);
  }

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


SWIGINTERNINLINE VALUE 
SWIG_FromCharPtr(const char *cptr)
{ 
  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 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 int
SWIG_AsVal_bool (VALUE obj, bool *val)
{
  if (obj == Qtrue) {
    if (val) *val = true;
    return SWIG_OK;
  } else if (obj == Qfalse) {
    if (val) *val = false;
    return SWIG_OK;
  } else {
    int res = 0;
    if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {    
      if (val) *val = res ? true : false;
      return SWIG_OK;
    }
  }  
  return SWIG_TypeError;
}

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 Datamatch *Dataiterator___next__(Dataiterator *self){

    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_each(Dataiterator *self){
    Datamatch *d;
    while ((d = Dataiterator___next__(self)) != 0) {
      rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(d), SWIGTYPE_p_Datamatch, SWIG_POINTER_OWN | 0));
    }
  }
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);
  }

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


#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE arg)
{
  VALUE *args = (VALUE *)arg;
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  long long *res = (long long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj);
  return obj;
}

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

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

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

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

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


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

SWIGINTERN 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 VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
{
  VALUE *args = (VALUE *)arg;
  VALUE obj = args[0];
  VALUE type = TYPE(obj);
  unsigned long *res = (unsigned long *)(args[1]);
  *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
  return obj;
}

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


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

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(VALUE obj, FILE **val) {







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




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



  if ((SWIG_ConvertPtr(obj, &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){

    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 void Pool_solvable_iterator_each(Pool_solvable_iterator *self){
    XSolvable *n;
    while ((n = Pool_solvable_iterator___next__(self)) != 0) {
      rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(n), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN | 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){

    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 void Pool_repo_iterator_each(Pool_repo_iterator *self){
    Repo *n;
    while ((n = Pool_repo_iterator___next__(self)) != 0) {
      rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(n), SWIGTYPE_p_Repo, 0 | 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){

    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 void Repo_solvable_iterator_each(Repo_solvable_iterator *self){
    XSolvable *n;
    while ((n = Repo_solvable_iterator___next__(self)) != 0) {
      rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(n), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN | 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 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) {
    XRepodata *xd = new_XRepodata(data->repo, data->repodataid);
    VALUE callable = (VALUE)d;
    VALUE rd = SWIG_NewPointerObj(SWIG_as_voidptr(xd), SWIGTYPE_p_XRepodata, SWIG_POINTER_OWN | 0);
    VALUE res = rb_funcall(callable, rb_intern("call"), 1, rd);
    return res == Qtrue;
  }
  SWIGINTERN void mark_Pool(void *ptr) {
    Pool *pool = ptr;
    if (pool->loadcallback == loadcallback && pool->loadcallbackdata) {
      VALUE callable = (VALUE)pool->loadcallbackdata;
      rb_gc_mark(callable);
    }
  }

SWIGINTERN void Pool_clr_loadcallback(Pool *self){
    pool_setloadcallback(self, 0, 0);
  }
SWIGINTERN void Pool_set_loadcallback(Pool *self,VALUE callable){
    pool_setloadcallback(self, callable ? loadcallback : 0, (void *)callable);
  }
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 Dep *Pool_parserpmrichdep(Pool *self,char const *str){
    Id id = pool_parserpmrichdep(self, str);
    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 bool Repo_add_rpmdb(Repo *self,int flags){
    return repo_add_rpmdb(self, 0, flags) == 0;
  }
SWIGINTERN bool Repo_add_rpmdb_reffp(Repo *self,FILE *reffp,int flags){
    return repo_add_rpmdb_reffp(self, reffp, flags) == 0;
  }
SWIGINTERN XSolvable *Repo_add_rpm(Repo *self,char const *name,int flags){
    return new_XSolvable(self->pool, repo_add_rpm(self, name, flags));
  }
SWIGINTERN bool Repo_add_rpmdb_pubkeys(Repo *self,int flags){
    return repo_add_rpmdb_pubkeys(self, flags) == 0;
  }
SWIGINTERN XSolvable *Repo_add_pubkey(Repo *self,char const *keyfile,int flags){
    return new_XSolvable(self->pool, repo_add_pubkey(self, keyfile, flags));
  }
SWIGINTERN bool Repo_add_keyring(Repo *self,FILE *fp,int flags){
    return repo_add_keyring(self, fp, flags);
  }
SWIGINTERN bool Repo_add_keydir(Repo *self,char const *keydir,char const *suffix,int flags){
    return repo_add_keydir(self, keydir, suffix, flags);
  }
SWIGINTERN bool Repo_add_rpmmd(Repo *self,FILE *fp,char const *language,int flags){
    return repo_add_rpmmd(self, fp, language, flags) == 0;
  }
SWIGINTERN bool Repo_add_repomdxml(Repo *self,FILE *fp,int flags){
    return repo_add_repomdxml(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_updateinfoxml(Repo *self,FILE *fp,int flags){
    return repo_add_updateinfoxml(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_deltainfoxml(Repo *self,FILE *fp,int flags){
    return repo_add_deltainfoxml(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_debdb(Repo *self,int flags){
    return repo_add_debdb(self, flags) == 0;
  }
SWIGINTERN bool Repo_add_debpackages(Repo *self,FILE *fp,int flags){
    return repo_add_debpackages(self, fp, flags) == 0;
  }
SWIGINTERN XSolvable *Repo_add_deb(Repo *self,char const *name,int flags){
    return new_XSolvable(self->pool, repo_add_deb(self, name, flags));
  }
SWIGINTERN bool Repo_add_susetags(Repo *self,FILE *fp,Id defvendor,char const *language,int flags){
    return repo_add_susetags(self, fp, defvendor, language, flags) == 0;
  }
SWIGINTERN bool Repo_add_content(Repo *self,FILE *fp,int flags){
    return repo_add_content(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_products(Repo *self,char const *proddir,int flags){
    return repo_add_products(self, proddir, flags) == 0;
  }
SWIGINTERN bool Repo_add_mdk(Repo *self,FILE *fp,int flags){
    return repo_add_mdk(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_mdk_info(Repo *self,FILE *fp,int flags){
    return repo_add_mdk_info(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_arch_repo(Repo *self,FILE *fp,int flags){
    return repo_add_arch_repo(self, fp, flags) == 0;
  }
SWIGINTERN bool Repo_add_arch_local(Repo *self,char const *dir,int flags){
    return repo_add_arch_local(self, dir, flags) == 0;
  }
SWIGINTERN XSolvable *Repo_add_arch_pkg(Repo *self,char const *name,int flags){
    return new_XSolvable(self->pool, repo_add_arch_pkg(self, name, flags));
  }
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 XSolvable *Repo_find_pubkey(Repo *self,char const *keyid){
    return new_XSolvable(self->pool, repo_find_pubkey(self, keyid));
  }
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 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 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);
  }

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

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 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 Solvsig *new_Solvsig(FILE *fp){
    return solvsig_create(fp);
  }
SWIGINTERN Chksum *Solvsig_Chksum(Solvsig *self){
    return self->htype ? (Chksum *)solv_chksum_create(self->htype) : 0;
  }
SWIGINTERN XSolvable *Solvsig_verify(Solvsig *self,Repo *repo,Chksum *chksum){
    Id p = solvsig_verify(self, repo, chksum);
    return new_XSolvable(repo->pool, p);
  }
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 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 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);
  }

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

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);
    }
  
static swig_class SwigClassSelection;

SWIGINTERN VALUE
_wrap_Selection_pool_get(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","pool", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_flags_get(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","flags", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = (int)(int) ((arg1)->flags);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Selection(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Selection *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Selection", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Selection *)new_Selection(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void delete_Selection(Selection *self){
    queue_free(&self->q);
    solv_free(self);
  }
SWIGINTERN void
free_Selection(void *self) {
    Selection *arg1 = (Selection *)self;
    delete_Selection(arg1);
}

SWIGINTERN VALUE
_wrap_Selection_isemptyq___(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","isempty", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = (bool)Selection_isempty(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Selection.clone

  call-seq:
    clone(flags=0) -> Selection

Create a duplicate of the class.
*/
SWIGINTERN VALUE
_wrap_Selection_clone(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","clone", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","clone", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)Selection_clone(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_filter(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","filter", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Selection *","filter", 2, argv[0] )); 
  }
  arg2 = (Selection *)(argp2);
  Selection_filter(arg1,arg2);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_add(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","add", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Selection *","add", 2, argv[0] )); 
  }
  arg2 = (Selection *)(argp2);
  Selection_add(arg1,arg2);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_add_raw(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","add_raw", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","add_raw", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_raw", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  Selection_add_raw(arg1,arg2,arg3);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_subtract(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  Selection *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","subtract", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Selection *","subtract", 2, argv[0] )); 
  }
  arg2 = (Selection *)(argp2);
  Selection_subtract(arg1,arg2);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Selection.select

  call-seq:
    select(name, flags)

Iterate thru each element in the Selection and select those that match a condition.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Selection_select(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","select", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","select", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","select", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  Selection_select(arg1,(char const *)arg2,arg3);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  {
    return self;
  }    return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_matchdeps(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","matchdeps", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","matchdeps", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchdeps", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchdeps", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchdeps", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  Selection_matchdeps(arg1,(char const *)arg2,arg3,arg4,arg5);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  {
    return self;
  }    return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_matchdepid(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  DepId arg2 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","matchdepid", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","matchdepid", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchdepid", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchdepid", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchdepid", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  Selection_matchdepid(arg1,arg2,arg3,arg4,arg5);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_matchsolvable(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","matchsolvable", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","matchsolvable", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchsolvable", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchsolvable", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchsolvable", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  Selection_matchsolvable(arg1,arg2,arg3,arg4,arg5);
  {
    return self;
  }    return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_jobs(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","jobs", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","jobs", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  result = Selection_jobs(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 2;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 2)
    {
      Id id = *idp;
#define result resultx
      Job * result = new_Job(arg1->pool, id, idp[1]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Job, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_solvables(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","solvables", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = Selection_solvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection_to_s(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","__str__", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = (char *)Selection___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Selection___repr__(int argc, VALUE *argv, VALUE self) {
  Selection *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Selection, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Selection *","__repr__", 1, self )); 
  }
  arg1 = (Selection *)(argp1);
  result = (char *)Selection___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassDep;

SWIGINTERN VALUE
_wrap_Dep_pool_get(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","pool", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_id_get(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","id", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Dep(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Dep *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Dep", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dep", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (Dep *)new_Dep(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_Rel(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  int arg2 ;
  DepId arg3 ;
  bool arg4 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","Rel", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Rel", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","Rel", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_bool(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","Rel", 4, argv[2] ));
    } 
    arg4 = (bool)(val4);
  }
  result = (Dep *)Dep_Rel(arg1,arg2,arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_Selection_name(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","Selection_name", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Selection_name", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)Dep_Selection_name(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_Selection_provides(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","Selection_provides", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Selection_provides", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)Dep_Selection_provides(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_str(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","str", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  result = (char *)Dep_str(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Dep.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_Dep___eq__(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  Dep *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","__eq__", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Dep *","__eq__", 2, argv[0] )); 
  }
  arg2 = (Dep *)(argp2);
  result = (bool)Dep___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep___ne__(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  Dep *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","__ne__", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Dep *","__ne__", 2, argv[0] )); 
  }
  arg2 = (Dep *)(argp2);
  result = (bool)Dep___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep_to_s(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","__str__", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  result = (char *)Dep___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dep___repr__(int argc, VALUE *argv, VALUE self) {
  Dep *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dep, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dep *","__repr__", 1, self )); 
  }
  arg1 = (Dep *)(argp1);
  result = (char *)Dep___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Dep(void *self) {
    Dep *arg1 = (Dep *)self;
    free((char *) arg1);
}

static swig_class SwigClassDataiterator;

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


SWIGINTERN VALUE
_wrap_new_Dataiterator(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Repo *arg2 = 0 ;
  Id arg3 ;
  Id arg4 ;
  char *arg5 = 0 ;
  int arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int res5 ;
  char *buf5 = 0 ;
  int alloc5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  Dataiterator *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Dataiterator", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Repo *","Dataiterator", 2, argv[1] )); 
  }
  arg2 = (Repo *)(argp2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Dataiterator", 3, argv[2] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","Dataiterator", 4, argv[3] ));
  } 
  arg4 = (Id)(val4);
  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","Dataiterator", 5, argv[4] ));
  }
  arg5 = (char *)(buf5);
  ecode6 = SWIG_AsVal_int(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","Dataiterator", 6, argv[5] ));
  } 
  arg6 = (int)(val6);
  result = (Dataiterator *)new_Dataiterator(arg1,arg2,arg3,arg4,(char const *)arg5,arg6);
  DATA_PTR(self) = result;
  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
  return self;
fail:
  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
  return Qnil;
}


SWIGINTERN void delete_Dataiterator(Dataiterator *self){
    dataiterator_free(self);
    solv_free(self);
  }
SWIGINTERN void
free_Dataiterator(void *self) {
    Dataiterator *arg1 = (Dataiterator *)self;
    delete_Dataiterator(arg1);
}

SWIGINTERN VALUE
_wrap_Dataiterator___next__(int argc, VALUE *argv, VALUE self) {
  Dataiterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Datamatch *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dataiterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dataiterator *","__next__", 1, self )); 
  }
  arg1 = (Dataiterator *)(argp1);
  result = (Datamatch *)Dataiterator___next__(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datamatch, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Dataiterator.each

  call-seq:
    each

Iterate thru each element in the Dataiterator.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Dataiterator_each(int argc, VALUE *argv, VALUE self) {
  Dataiterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dataiterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dataiterator *","each", 1, self )); 
  }
  arg1 = (Dataiterator *)(argp1);
  Dataiterator_each(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dataiterator_prepend_keyname(int argc, VALUE *argv, VALUE self) {
  Dataiterator *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dataiterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dataiterator *","prepend_keyname", 1, self )); 
  }
  arg1 = (Dataiterator *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","prepend_keyname", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  Dataiterator_prepend_keyname(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Dataiterator_skip_solvable(int argc, VALUE *argv, VALUE self) {
  Dataiterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Dataiterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Dataiterator *","skip_solvable", 1, self )); 
  }
  arg1 = (Dataiterator *)(argp1);
  Dataiterator_skip_solvable(arg1);
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassXSolvable;

SWIGINTERN VALUE
_wrap_XSolvable_pool_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","pool", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_id_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","id", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_XSolvable(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XSolvable *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","XSolvable", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","XSolvable", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (XSolvable *)new_XSolvable(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_str(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","str", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_str(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_str(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_str", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (char *)XSolvable_lookup_str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_id(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_id", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Id)XSolvable_lookup_id(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_num(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  unsigned long long arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  unsigned long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_num", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_num", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long long","lookup_num", 3, argv[1] ));
    } 
    arg3 = (unsigned long long)(val3);
  }
  result = (unsigned long long)XSolvable_lookup_num(arg1,arg2,arg3);
  vresult = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_void(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_void", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_void", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (bool)XSolvable_lookup_void(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_checksum(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_checksum", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_checksum", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Chksum *)XSolvable_lookup_checksum(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_idarray(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Id arg3 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_idarray", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_idarray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_idarray", 3, argv[1] ));
    } 
    arg3 = (Id)(val3);
  }
  result = XSolvable_lookup_idarray(arg1,arg2,arg3);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_deparray(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  Id arg3 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_deparray", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_deparray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_deparray", 3, argv[1] ));
    } 
    arg3 = (Id)(val3);
  }
  result = XSolvable_lookup_deparray(arg1,arg2,arg3);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      Dep * result = new_Dep(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_location(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  unsigned int *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int temp2 ;
  int res2 = SWIG_TMPOBJ ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  arg2 = &temp2;
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_location", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_lookup_location(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  if (SWIG_IsTmpObj(res2)) {
    vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg2)), 0);
  } else {
    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
    vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_unsigned_int, new_flags), 0);
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_lookup_sourcepkg(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","lookup_sourcepkg", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_lookup_sourcepkg(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_Dataiterator(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","Dataiterator", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","Dataiterator", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Dataiterator", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (Dataiterator *)XSolvable_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_installableq___(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","installable", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (bool)XSolvable_installable(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_isinstalledq___(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","isinstalled", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (bool)XSolvable_isinstalled(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_name_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","name", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","name", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  XSolvable_name_set(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_name_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","name", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_name_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_nameid_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","nameid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","nameid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  XSolvable_nameid_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_nameid_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","nameid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Id)XSolvable_nameid_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_evr_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","evr", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","evr", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  XSolvable_evr_set(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_evr_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","evr", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_evr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_evrid_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","evrid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","evrid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  XSolvable_evrid_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_evrid_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","evrid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Id)XSolvable_evrid_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_arch_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","arch", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","arch", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  XSolvable_arch_set(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_arch_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","arch", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_arch_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_archid_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","archid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","archid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  XSolvable_archid_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_archid_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","archid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Id)XSolvable_archid_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_vendor_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","vendor", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","vendor", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  XSolvable_vendor_set(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_vendor_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","vendor", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable_vendor_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_vendorid_set(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","vendorid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","vendorid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  XSolvable_vendorid_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_vendorid_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","vendorid", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Id)XSolvable_vendorid_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_repo_get(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","repo", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (Repo *)XSolvable_repo_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_provides(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  Id arg3 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_provides", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_provides", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_provides", 3, argv[1] ));
    } 
    arg3 = (Id)(val3);
  }
  XSolvable_add_provides(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_obsoletes(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_obsoletes", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_obsoletes", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_obsoletes(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_conflicts(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_conflicts", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_conflicts", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_conflicts(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_requires(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  Id arg3 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_requires", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_requires", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_requires", 3, argv[1] ));
    } 
    arg3 = (Id)(val3);
  }
  XSolvable_add_requires(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_recommends(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_recommends", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_recommends", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_recommends(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_suggests(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_suggests", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_suggests", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_suggests(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_supplements(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_supplements", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_supplements", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_supplements(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_enhances(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_enhances", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","add_enhances", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  XSolvable_add_enhances(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_unset(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","unset", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","unset", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  XSolvable_unset(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_add_deparray(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","add_deparray", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","add_deparray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","add_deparray", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","add_deparray", 4, argv[2] ));
    } 
    arg4 = (Id)(val4);
  }
  XSolvable_add_deparray(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_Selection(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","Selection", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Selection", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)XSolvable_Selection(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_identicalq___(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","identical", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","identical", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (bool)XSolvable_identical(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_evrcmp(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","evrcmp", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","evrcmp", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (int)XSolvable_evrcmp(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_matchesdepq___(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","matchesdep", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","matchesdep", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","matchesdep", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchesdep", 4, argv[2] ));
    } 
    arg4 = (Id)(val4);
  }
  result = (bool)XSolvable_matchesdep(arg1,arg2,arg3,arg4);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::XSolvable.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_XSolvable___eq__(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","__eq__", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","__eq__", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (bool)XSolvable___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable___ne__(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","__ne__", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","__ne__", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (bool)XSolvable___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable_to_s(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","__str__", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XSolvable___repr__(int argc, VALUE *argv, VALUE self) {
  XSolvable *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XSolvable *","__repr__", 1, self )); 
  }
  arg1 = (XSolvable *)(argp1);
  result = (char *)XSolvable___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_XSolvable(void *self) {
    XSolvable *arg1 = (XSolvable *)self;
    free((char *) arg1);
}

static swig_class SwigClassRuleinfo;

SWIGINTERN VALUE
_wrap_Ruleinfo_solv_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","solv", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_type_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","type", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (int)(int) ((arg1)->type);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_dep_id_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","dep_id", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (Id)(Id) ((arg1)->dep_id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Ruleinfo(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  Id arg5 ;
  Id arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  Ruleinfo *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","Ruleinfo", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Ruleinfo", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Ruleinfo", 3, argv[2] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","Ruleinfo", 4, argv[3] ));
  } 
  arg4 = (Id)(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","Ruleinfo", 5, argv[4] ));
  } 
  arg5 = (Id)(val5);
  ecode6 = SWIG_AsVal_int(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "Id","Ruleinfo", 6, argv[5] ));
  } 
  arg6 = (Id)(val6);
  result = (Ruleinfo *)new_Ruleinfo(arg1,arg2,arg3,arg4,arg5,arg6);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_solvable_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","solvable", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (XSolvable *)Ruleinfo_solvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_othersolvable_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","othersolvable", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (XSolvable *)Ruleinfo_othersolvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_dep_get(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","dep", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (Dep *)Ruleinfo_dep_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_problemstr(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","problemstr", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (char *)Ruleinfo_problemstr(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Ruleinfo_to_s(int argc, VALUE *argv, VALUE self) {
  Ruleinfo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Ruleinfo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Ruleinfo *","__str__", 1, self )); 
  }
  arg1 = (Ruleinfo *)(argp1);
  result = (char *)Ruleinfo___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Ruleinfo(void *self) {
    Ruleinfo *arg1 = (Ruleinfo *)self;
    free((char *) arg1);
}

static swig_class SwigClassXRule;

SWIGINTERN VALUE
_wrap_XRule_solv_get(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","solv", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_id_get(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","id", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_XRule(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XRule *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","XRule", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","XRule", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (XRule *)new_XRule(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_type_get(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","type", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = (int)XRule_type_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_info(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Ruleinfo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","info", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = (Ruleinfo *)XRule_info(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Ruleinfo, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_allinfos(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","allinfos", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = XRule_allinfos(arg1);
  {
    int i;
    int cnt = (&result)->count / 4;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Ruleinfo, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_get_learnt(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","get_learnt", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = XRule_get_learnt(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XRule * result = new_XRule(arg1->solv, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_get_decisionlist(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","get_decisionlist", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = XRule_get_decisionlist(arg1);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule_get_decisionsetlist(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","get_decisionsetlist", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = XRule_get_decisionsetlist(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decisionset, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::XRule.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_XRule___eq__(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  XRule *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","__eq__", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XRule *","__eq__", 2, argv[0] )); 
  }
  arg2 = (XRule *)(argp2);
  result = (bool)XRule___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule___ne__(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  XRule *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","__ne__", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XRule *","__ne__", 2, argv[0] )); 
  }
  arg2 = (XRule *)(argp2);
  result = (bool)XRule___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRule___repr__(int argc, VALUE *argv, VALUE self) {
  XRule *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRule, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRule *","__repr__", 1, self )); 
  }
  arg1 = (XRule *)(argp1);
  result = (char *)XRule___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_XRule(void *self) {
    XRule *arg1 = (XRule *)self;
    free((char *) arg1);
}

static swig_class SwigClassXRepodata;

SWIGINTERN VALUE
_wrap_XRepodata_repo_get(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","repo", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  result = (Repo *)(Repo *) ((arg1)->repo);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_id_get(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","id", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_XRepodata(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XRepodata *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","XRepodata", 1, argv[0] )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","XRepodata", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (XRepodata *)new_XRepodata(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_new_handle(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","new_handle", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  result = (Id)XRepodata_new_handle(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_id(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  DepId arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  DepId val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_id", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_id", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsValDepId(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "DepId","set_id", 4, argv[2] ));
  } 
  arg4 = (DepId)(val4);
  XRepodata_set_id(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_num(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  unsigned long long val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_num", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_num", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_num", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_long_SS_long(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned long long","set_num", 4, argv[2] ));
  } 
  arg4 = (unsigned long long)(val4);
  XRepodata_set_num(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_str(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_str", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_str", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","set_str", 4, argv[2] ));
  }
  arg4 = (char *)(buf4);
  XRepodata_set_str(arg1,arg2,arg3,(char const *)arg4);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
fail:
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_void(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_void", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_void", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_void", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  XRepodata_set_void(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_poolstr(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_poolstr", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_poolstr", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_poolstr", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","set_poolstr", 4, argv[2] ));
  }
  arg4 = (char *)(buf4);
  XRepodata_set_poolstr(arg1,arg2,arg3,(char const *)arg4);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
fail:
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_add_idarray(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  DepId arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  DepId val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","add_idarray", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","add_idarray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_idarray", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsValDepId(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "DepId","add_idarray", 4, argv[2] ));
  } 
  arg4 = (DepId)(val4);
  XRepodata_add_idarray(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_add_flexarray(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","add_flexarray", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","add_flexarray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_flexarray", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","add_flexarray", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  XRepodata_add_flexarray(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_checksum(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Chksum *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_checksum", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_checksum", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","set_checksum", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "Chksum *","set_checksum", 4, argv[2] )); 
  }
  arg4 = (Chksum *)(argp4);
  XRepodata_set_checksum(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_sourcepkg(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_sourcepkg", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_sourcepkg", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","set_sourcepkg", 3, argv[1] ));
  }
  arg3 = (char *)(buf3);
  XRepodata_set_sourcepkg(arg1,arg2,(char const *)arg3);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_set_location(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  unsigned int arg3 ;
  char *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","set_location", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","set_location", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","set_location", 3, argv[1] ));
  } 
  arg3 = (unsigned int)(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","set_location", 4, argv[2] ));
  }
  arg4 = (char *)(buf4);
  XRepodata_set_location(arg1,arg2,arg3,(char const *)arg4);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
fail:
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_unset(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","unset", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","unset", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","unset", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  XRepodata_unset(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_str(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_str", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_str", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (char *)XRepodata_lookup_str(arg1,arg2,arg3);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_id(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_id", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_id", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (Id)XRepodata_lookup_id(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_num(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  unsigned long long val4 ;
  int ecode4 = 0 ;
  unsigned long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_num", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_num", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_num", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_unsigned_SS_long_SS_long(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned long long","lookup_num", 4, argv[2] ));
    } 
    arg4 = (unsigned long long)(val4);
  }
  result = (unsigned long long)XRepodata_lookup_num(arg1,arg2,arg3,arg4);
  vresult = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_void(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_void", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_void", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_void", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (bool)XRepodata_lookup_void(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_idarray(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_idarray", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_idarray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_idarray", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = XRepodata_lookup_idarray(arg1,arg2,arg3);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_lookup_checksum(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","lookup_checksum", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_checksum", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_checksum", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (Chksum *)XRepodata_lookup_checksum(arg1,arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_internalize(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","internalize", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  XRepodata_internalize(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_create_stubs(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","create_stubs", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  XRepodata_create_stubs(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_write(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  FILE *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","write", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","write", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  result = (bool)XRepodata_write(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_str2dir(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","str2dir", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","str2dir", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_bool(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","str2dir", 3, argv[1] ));
    } 
    arg3 = (bool)(val3);
  }
  result = (Id)XRepodata_str2dir(arg1,(char const *)arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_dir2str(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","dir2str", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","dir2str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","dir2str", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  result = (char *)XRepodata_dir2str(arg1,arg2,(char const *)arg3);
  vresult = SWIG_FromCharPtr((const char *)result);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_add_dirstr(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  char *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int res5 ;
  char *buf5 = 0 ;
  int alloc5 = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","add_dirstr", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","add_dirstr", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_dirstr", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","add_dirstr", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","add_dirstr", 5, argv[3] ));
  }
  arg5 = (char *)(buf5);
  XRepodata_add_dirstr(arg1,arg2,arg3,arg4,(char const *)arg5);
  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
  return Qnil;
fail:
  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_add_solv(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","add_solv", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_solv", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_solv", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)XRepodata_add_solv(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata_extend_to_repo(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","extend_to_repo", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  XRepodata_extend_to_repo(arg1);
  return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::XRepodata.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_XRepodata___eq__(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  XRepodata *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","__eq__", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XRepodata *","__eq__", 2, argv[0] )); 
  }
  arg2 = (XRepodata *)(argp2);
  result = (bool)XRepodata___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata___ne__(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  XRepodata *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","__ne__", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XRepodata *","__ne__", 2, argv[0] )); 
  }
  arg2 = (XRepodata *)(argp2);
  result = (bool)XRepodata___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_XRepodata___repr__(int argc, VALUE *argv, VALUE self) {
  XRepodata *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_XRepodata, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "XRepodata *","__repr__", 1, self )); 
  }
  arg1 = (XRepodata *)(argp1);
  result = (char *)XRepodata___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_XRepodata(void *self) {
    XRepodata *arg1 = (XRepodata *)self;
    free((char *) arg1);
}

static swig_class SwigClassPool_solvable_iterator;

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


SWIGINTERN VALUE
_wrap_new_Pool_solvable_iterator(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Pool_solvable_iterator", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_solvable_iterator *)new_Pool_solvable_iterator(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvable_iterator___next__(int argc, VALUE *argv, VALUE self) {
  Pool_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_solvable_iterator *","__next__", 1, self )); 
  }
  arg1 = (Pool_solvable_iterator *)(argp1);
  result = (XSolvable *)Pool_solvable_iterator___next__(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Pool_solvable_iterator.each

  call-seq:
    each

Iterate thru each element in the Pool_solvable_iterator.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Pool_solvable_iterator_each(int argc, VALUE *argv, VALUE self) {
  Pool_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_solvable_iterator *","each", 1, self )); 
  }
  arg1 = (Pool_solvable_iterator *)(argp1);
  Pool_solvable_iterator_each(arg1);
  return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Pool_solvable_iterator.[]

  call-seq:
    [](key) -> XSolvable

Element accessor/slicing.
*/
SWIGINTERN VALUE
_wrap_Pool_solvable_iterator___getitem__(int argc, VALUE *argv, VALUE self) {
  Pool_solvable_iterator *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_solvable_iterator *","__getitem__", 1, self )); 
  }
  arg1 = (Pool_solvable_iterator *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","__getitem__", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (XSolvable *)Pool_solvable_iterator___getitem__(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvable_iterator___len__(int argc, VALUE *argv, VALUE self) {
  Pool_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_solvable_iterator *","__len__", 1, self )); 
  }
  arg1 = (Pool_solvable_iterator *)(argp1);
  result = (int)Pool_solvable_iterator___len__(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Pool_solvable_iterator(void *self) {
    Pool_solvable_iterator *arg1 = (Pool_solvable_iterator *)self;
    free((char *) arg1);
}

static swig_class SwigClassPool_repo_iterator;

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


SWIGINTERN VALUE
_wrap_new_Pool_repo_iterator(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Pool_repo_iterator", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_repo_iterator *)new_Pool_repo_iterator(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_repo_iterator___next__(int argc, VALUE *argv, VALUE self) {
  Pool_repo_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_repo_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_repo_iterator *","__next__", 1, self )); 
  }
  arg1 = (Pool_repo_iterator *)(argp1);
  result = (Repo *)Pool_repo_iterator___next__(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Pool_repo_iterator.each

  call-seq:
    each

Iterate thru each element in the Pool_repo_iterator.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Pool_repo_iterator_each(int argc, VALUE *argv, VALUE self) {
  Pool_repo_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_repo_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_repo_iterator *","each", 1, self )); 
  }
  arg1 = (Pool_repo_iterator *)(argp1);
  Pool_repo_iterator_each(arg1);
  return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Pool_repo_iterator.[]

  call-seq:
    [](key) -> Repo

Element accessor/slicing.
*/
SWIGINTERN VALUE
_wrap_Pool_repo_iterator___getitem__(int argc, VALUE *argv, VALUE self) {
  Pool_repo_iterator *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_repo_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_repo_iterator *","__getitem__", 1, self )); 
  }
  arg1 = (Pool_repo_iterator *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","__getitem__", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Repo *)Pool_repo_iterator___getitem__(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_repo_iterator___len__(int argc, VALUE *argv, VALUE self) {
  Pool_repo_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool_repo_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool_repo_iterator *","__len__", 1, self )); 
  }
  arg1 = (Pool_repo_iterator *)(argp1);
  result = (int)Pool_repo_iterator___len__(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Pool_repo_iterator(void *self) {
    Pool_repo_iterator *arg1 = (Pool_repo_iterator *)self;
    free((char *) arg1);
}

static swig_class SwigClassRepo_solvable_iterator;

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


SWIGINTERN VALUE
_wrap_new_Repo_solvable_iterator(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","Repo_solvable_iterator", 1, argv[0] )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Repo_solvable_iterator *)new_Repo_solvable_iterator(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_solvable_iterator___next__(int argc, VALUE *argv, VALUE self) {
  Repo_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo_solvable_iterator *","__next__", 1, self )); 
  }
  arg1 = (Repo_solvable_iterator *)(argp1);
  result = (XSolvable *)Repo_solvable_iterator___next__(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Repo_solvable_iterator.each

  call-seq:
    each

Iterate thru each element in the Repo_solvable_iterator.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Repo_solvable_iterator_each(int argc, VALUE *argv, VALUE self) {
  Repo_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo_solvable_iterator *","each", 1, self )); 
  }
  arg1 = (Repo_solvable_iterator *)(argp1);
  Repo_solvable_iterator_each(arg1);
  return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Repo_solvable_iterator.[]

  call-seq:
    [](key) -> XSolvable

Element accessor/slicing.
*/
SWIGINTERN VALUE
_wrap_Repo_solvable_iterator___getitem__(int argc, VALUE *argv, VALUE self) {
  Repo_solvable_iterator *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo_solvable_iterator *","__getitem__", 1, self )); 
  }
  arg1 = (Repo_solvable_iterator *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","__getitem__", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (XSolvable *)Repo_solvable_iterator___getitem__(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_solvable_iterator___len__(int argc, VALUE *argv, VALUE self) {
  Repo_solvable_iterator *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo_solvable_iterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo_solvable_iterator *","__len__", 1, self )); 
  }
  arg1 = (Repo_solvable_iterator *)(argp1);
  result = (int)Repo_solvable_iterator___len__(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Repo_solvable_iterator(void *self) {
    Repo_solvable_iterator *arg1 = (Repo_solvable_iterator *)self;
    free((char *) arg1);
}

static swig_class SwigClassDatamatch;

SWIGINTERN VALUE
_wrap_Datamatch_pool_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","pool", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_repo_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","repo", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Repo *)(Repo *) ((arg1)->repo);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_solvid_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","solvid", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Id)(Id) ((arg1)->solvid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void delete_Datamatch(Datamatch *self){
    dataiterator_free(self);
    solv_free(self);
  }
SWIGINTERN void
free_Datamatch(void *self) {
    Datamatch *arg1 = (Datamatch *)self;
    delete_Datamatch(arg1);
}

SWIGINTERN VALUE
_wrap_Datamatch_solvable_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","solvable", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (XSolvable *)Datamatch_solvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_key_id_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","key_id", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Id)Datamatch_key_id_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_key_idstr_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","key_idstr", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (char *)Datamatch_key_idstr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_type_id_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","type_id", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Id)Datamatch_type_id_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_type_idstr_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","type_idstr", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (char *)Datamatch_type_idstr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_id_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","id", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Id)Datamatch_id_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_idstr_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","idstr", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (char *)Datamatch_idstr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_str_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","str", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (char *)Datamatch_str_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_dep_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","dep", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Dep *)Datamatch_dep_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_binary_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  BinaryBlob result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","binary", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = Datamatch_binary_get(arg1);
  vresult = SWIG_FromCharPtrAndSize((&result)->data, (&result)->len);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_num_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","num", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (unsigned long long)Datamatch_num_get(arg1);
  vresult = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_num2_get(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","num2", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (unsigned int)Datamatch_num2_get(arg1);
  vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_pos(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Datapos *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","pos", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Datapos *)Datamatch_pos(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datapos, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_parentpos(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Datapos *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","parentpos", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (Datapos *)Datamatch_parentpos(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datapos, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datamatch_to_s(int argc, VALUE *argv, VALUE self) {
  Datamatch *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datamatch, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datamatch *","__str__", 1, self )); 
  }
  arg1 = (Datamatch *)(argp1);
  result = (char *)Datamatch___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassDatapos;

SWIGINTERN VALUE
_wrap_Datapos_repo_get(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","repo", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  result = (Repo *)(Repo *) ((arg1)->repo);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_id(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_id", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Id)Datapos_lookup_id(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_str(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_str", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (char *)Datapos_lookup_str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_num(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  unsigned long long arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  unsigned long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_num", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_num", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long long","lookup_num", 3, argv[1] ));
    } 
    arg3 = (unsigned long long)(val3);
  }
  result = (unsigned long long)Datapos_lookup_num(arg1,arg2,arg3);
  vresult = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_void(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_void", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_void", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (bool)Datapos_lookup_void(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_checksum(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_checksum", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_checksum", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Chksum *)Datapos_lookup_checksum(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_deltaseq(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_deltaseq", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  result = (char *)Datapos_lookup_deltaseq(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_deltalocation(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  unsigned int *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int temp2 ;
  int res2 = SWIG_TMPOBJ ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  arg2 = &temp2;
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_deltalocation", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  result = (char *)Datapos_lookup_deltalocation(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  if (SWIG_IsTmpObj(res2)) {
    vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg2)), 0);
  } else {
    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
    vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_unsigned_int, new_flags), 0);
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_lookup_idarray(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","lookup_idarray", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_idarray", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = Datapos_lookup_idarray(arg1,arg2);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Datapos_Dataiterator(int argc, VALUE *argv, VALUE self) {
  Datapos *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Datapos, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Datapos *","Dataiterator", 1, self )); 
  }
  arg1 = (Datapos *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","Dataiterator", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Dataiterator", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (Dataiterator *)Datapos_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN void
free_Datapos(void *self) {
    Datapos *arg1 = (Datapos *)self;
    free((char *) arg1);
}

static swig_class SwigClassJob;

SWIGINTERN VALUE
_wrap_Job_pool_get(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","pool", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_how_set(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","how", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","how", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->how = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_how_get(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","how", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (int) ((arg1)->how);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_what_set(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","what", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","what", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (arg1) (arg1)->what = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_what_get(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","what", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (Id) ((arg1)->what);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Job(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Job *result = 0 ;
  
  if ((argc < 3) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Job", 1, argv[0] )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Job", 2, argv[1] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Job", 3, argv[2] ));
  } 
  arg3 = (Id)(val3);
  result = (Job *)new_Job(arg1,arg2,arg3);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_solvables(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","solvables", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = Job_solvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_isemptyupdateq___(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","isemptyupdate", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (bool)Job_isemptyupdate(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Job.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_Job___eq__(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  Job *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","__eq__", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Job *","__eq__", 2, argv[0] )); 
  }
  arg2 = (Job *)(argp2);
  result = (bool)Job___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job___ne__(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  Job *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","__ne__", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Job *","__ne__", 2, argv[0] )); 
  }
  arg2 = (Job *)(argp2);
  result = (bool)Job___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job_to_s(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","__str__", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (char *)Job___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Job___repr__(int argc, VALUE *argv, VALUE self) {
  Job *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Job, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Job *","__repr__", 1, self )); 
  }
  arg1 = (Job *)(argp1);
  result = (char *)Job___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Job(void *self) {
    Job *arg1 = (Job *)self;
    free((char *) arg1);
}

static swig_class SwigClassPool;

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


SWIGINTERN VALUE
_wrap_new_Pool(int argc, VALUE *argv, VALUE self) {
  Pool *result = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  result = (Pool *)new_Pool();
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_setdisttype(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","setdisttype", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","setdisttype", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  result = (int)Pool_setdisttype(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_debuglevel(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_debuglevel", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","set_debuglevel", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  Pool_set_debuglevel(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_flag(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_flag", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","set_flag", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_flag", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  result = (int)Pool_set_flag(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_get_flag(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","get_flag", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","get_flag", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  result = (int)Pool_get_flag(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_rootdir(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_rootdir", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","set_rootdir", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  Pool_set_rootdir(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_get_rootdir(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","get_rootdir", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","get_rootdir", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  result = (char *)Pool_get_rootdir(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_clr_loadcallback(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","clr_loadcallback", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  Pool_clr_loadcallback(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_loadcallback(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  VALUE arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  {
    arg2 = rb_block_given_p() ? rb_block_proc() : 0;
  }
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_loadcallback", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  Pool_set_loadcallback(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


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 void
free_Pool(void *self) {
    Pool *arg1 = (Pool *)self;
    delete_Pool(arg1);
}

SWIGINTERN VALUE
_wrap_Pool_free(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  disown_helper result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","free", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_free(arg1);
  {
    SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN |  0 );
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    vresult = SWIG_From_int((int)(0));
    
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_disown(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  disown_helper result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","disown", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_disown(arg1);
  {
    SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN |  0 );
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    vresult = SWIG_From_int((int)(0));
    
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_appdata_set(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  AppObjectPtr arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","appdata", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    arg2 = (void *)argv[0];
  }
  Pool_appdata_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_appdata_get(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  AppObjectPtr result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","appdata", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (AppObjectPtr)Pool_appdata_get(arg1);
  {
    vresult = (VALUE)result;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_appdata_disown(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","appdata_disown", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  Pool_appdata_disown(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_str2id(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","str2id", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","str2id", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_bool(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","str2id", 3, argv[1] ));
    } 
    arg3 = (bool)(val3);
  }
  result = (Id)Pool_str2id(arg1,(char const *)arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Dep(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  bool arg3 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  bool val3 ;
  int ecode3 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Dep", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Dep", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_bool(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Dep", 3, argv[1] ));
    } 
    arg3 = (bool)(val3);
  }
  result = (Dep *)Pool_Dep(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_parserpmrichdep(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","parserpmrichdep", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","parserpmrichdep", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  result = (Dep *)Pool_parserpmrichdep(arg1,(char const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, 0 |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_id2str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","id2str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","id2str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (char *)Pool_id2str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_dep2str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","dep2str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","dep2str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (char *)Pool_dep2str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_rel2id(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  int arg4 ;
  bool arg5 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  bool val5 ;
  int ecode5 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","rel2id", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","rel2id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","rel2id", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","rel2id", 4, argv[2] ));
  } 
  arg4 = (int)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_bool(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "bool","rel2id", 5, argv[3] ));
    } 
    arg5 = (bool)(val5);
  }
  result = (Id)Pool_rel2id(arg1,arg2,arg3,arg4,arg5);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_id2langid(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  bool arg4 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","id2langid", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","id2langid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","id2langid", 3, argv[1] ));
  }
  arg3 = (char *)(buf3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_bool(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","id2langid", 4, argv[2] ));
    } 
    arg4 = (bool)(val4);
  }
  result = (Id)Pool_id2langid(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_From_int((int)(result));
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_setarch(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","setarch", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  if (argc > 0) {
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setarch", 2, argv[0] ));
    }
    arg2 = (char *)(buf2);
  }
  Pool_setarch(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_add_repo(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","add_repo", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_repo", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  result = (Repo *)Pool_add_repo(arg1,(char const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_lookup_str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","lookup_str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_str", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (char *)Pool_lookup_str(arg1,arg2,arg3);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_lookup_id(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","lookup_id", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_id", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_id", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (Id)Pool_lookup_id(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_lookup_num(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  unsigned long long arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  unsigned long long val4 ;
  int ecode4 = 0 ;
  unsigned long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","lookup_num", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_num", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_num", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_unsigned_SS_long_SS_long(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned long long","lookup_num", 4, argv[2] ));
    } 
    arg4 = (unsigned long long)(val4);
  }
  result = (unsigned long long)Pool_lookup_num(arg1,arg2,arg3,arg4);
  vresult = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_lookup_void(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","lookup_void", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_void", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_void", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (bool)Pool_lookup_void(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_lookup_checksum(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","lookup_checksum", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","lookup_checksum", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","lookup_checksum", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (Chksum *)Pool_lookup_checksum(arg1,arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Dataiterator(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Dataiterator", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","Dataiterator", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Dataiterator", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (Dataiterator *)Pool_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Dataiterator_solvid(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  char *arg4 = 0 ;
  int arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Dataiterator_solvid", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator_solvid", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Dataiterator_solvid", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  if (argc > 2) {
    res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","Dataiterator_solvid", 4, argv[2] ));
    }
    arg4 = (char *)(buf4);
  }
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","Dataiterator_solvid", 5, argv[3] ));
    } 
    arg5 = (int)(val5);
  }
  result = (Dataiterator *)Pool_Dataiterator_solvid(arg1,arg2,arg3,(char const *)arg4,arg5);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return vresult;
fail:
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvid2str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","solvid2str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","solvid2str", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (char *)Pool_solvid2str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvidset2str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","solvidset2str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      int v;
      int e = SWIG_AsVal_int(*o, &v);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_TypeError, "list in argument 2 must contain only " "integers");
      queue_push(&arg2, v);
    }
  }
  
  result = (char *)Pool_solvidset2str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  {
    queue_free(&arg2);
  }
  return vresult;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvableset2str(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","solvableset2str", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      XSolvable * obj;
      int e = SWIG_ConvertPtr(*o, (void **)&obj, SWIGTYPE_p_XSolvable, 0 | 0);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_ArgError(e), "list in argument 2 must contain only ""XSolvable *");
      queue_push(&arg2, obj->id);
    }
  }
  
  result = (char *)Pool_solvableset2str(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  {
    queue_free(&arg2);
  }
  return vresult;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_addfileprovides(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","addfileprovides", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  Pool_addfileprovides(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_addfileprovides_queue(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","addfileprovides_queue", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_addfileprovides_queue(arg1);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_createwhatprovides(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","createwhatprovides", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  Pool_createwhatprovides(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_id2solvable(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","id2solvable", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","id2solvable", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (XSolvable *)Pool_id2solvable(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvables_get(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","solvables", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_solvable_iterator *)Pool_solvables_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool_solvable_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_solvables_iter(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_solvable_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","solvables_iter", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_solvable_iterator *)Pool_solvables_iter(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool_solvable_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_id2repo(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","id2repo", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","id2repo", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Repo *)Pool_id2repo(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_repos_get(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","repos", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_repo_iterator *)Pool_repos_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool_repo_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_repos_iter(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool_repo_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","repos_iter", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Pool_repo_iterator *)Pool_repos_iter(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool_repo_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_installed_set(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Repo *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","installed", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Repo, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Repo *","installed", 2, argv[0] )); 
  }
  arg2 = (Repo *)(argp2);
  Pool_installed_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_installed_get(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","installed", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Repo *)Pool_installed_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_errstr_get(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","errstr", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (char *)Pool_errstr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_matchprovidingids(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","matchprovidingids", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","matchprovidingids", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchprovidingids", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  result = Pool_matchprovidingids(arg1,(char const *)arg2,arg3);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Job(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Job *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Job", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Job", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Job", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  result = (Job *)Pool_Job(arg1,arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Job, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_whatprovides(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","whatprovides", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","whatprovides", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  result = Pool_whatprovides(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_best_solvables(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","best_solvables", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      XSolvable * obj;
      int e = SWIG_ConvertPtr(*o, (void **)&obj, SWIGTYPE_p_XSolvable, 0 | 0);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_ArgError(e), "list in argument 2 must contain only ""XSolvable *");
      queue_push(&arg2, obj->id);
    }
  }
  
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","best_solvables", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = Pool_best_solvables(arg1,arg2,arg3);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  {
    queue_free(&arg2);
  }
  return vresult;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_towhatprovides(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","towhatprovides", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      int v;
      int e = SWIG_AsVal_int(*o, &v);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_TypeError, "list in argument 2 must contain only " "integers");
      queue_push(&arg2, v);
    }
  }
  
  result = (Id)Pool_towhatprovides(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  {
    queue_free(&arg2);
  }
  return vresult;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_namespaceproviders(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  DepId arg2 ;
  DepId arg3 ;
  bool arg4 = 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  bool val4 ;
  int ecode4 = 0 ;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_namespaceproviders", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","set_namespaceproviders", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","set_namespaceproviders", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_bool(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "bool","set_namespaceproviders", 4, argv[2] ));
    } 
    arg4 = (bool)(val4);
  }
  Pool_set_namespaceproviders(arg1,arg2,arg3,arg4);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_flush_namespaceproviders(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  DepId arg2 ;
  DepId arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","flush_namespaceproviders", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","flush_namespaceproviders", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","flush_namespaceproviders", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  Pool_flush_namespaceproviders(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_whatcontainsdep(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","whatcontainsdep", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","whatcontainsdep", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","whatcontainsdep", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","whatcontainsdep", 4, argv[2] ));
    } 
    arg4 = (Id)(val4);
  }
  result = Pool_whatcontainsdep(arg1,arg2,arg3,arg4);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_whatmatchesdep(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  DepId arg3 ;
  Id arg4 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  DepId val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","whatmatchesdep", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","whatmatchesdep", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsValDepId(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "DepId","whatmatchesdep", 3, argv[1] ));
  } 
  arg3 = (DepId)(val3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","whatmatchesdep", 4, argv[2] ));
    } 
    arg4 = (Id)(val4);
  }
  result = Pool_whatmatchesdep(arg1,arg2,arg3,arg4);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_whatmatchessolvable(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Id arg2 ;
  XSolvable *arg3 = 0 ;
  Id arg4 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","whatmatchessolvable", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","whatmatchessolvable", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "XSolvable *","whatmatchessolvable", 3, argv[1] )); 
  }
  arg3 = (XSolvable *)(argp3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","whatmatchessolvable", 4, argv[2] ));
    } 
    arg4 = (Id)(val4);
  }
  result = Pool_whatmatchessolvable(arg1,arg2,arg3,arg4);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_isknownarchq___(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  DepId arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","isknownarch", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","isknownarch", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  result = (bool)Pool_isknownarch(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Solver(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Solver", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Solver *)Pool_Solver(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Selection(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Selection", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = (Selection *)Pool_Selection(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_Selection_all(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","Selection_all", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Selection_all", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)Pool_Selection_all(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Pool.select

  call-seq:
    select(name, flags) -> Selection

Iterate thru each element in the Pool and select those that match a condition.  A block must be provided.
*/
SWIGINTERN VALUE
_wrap_Pool_select(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","select", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","select", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","select", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  result = (Selection *)Pool_select(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_matchdeps(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","matchdeps", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","matchdeps", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchdeps", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchdeps", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchdeps", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  result = (Selection *)Pool_matchdeps(arg1,(char const *)arg2,arg3,arg4,arg5);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_matchdepid(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  DepId arg2 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  DepId val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","matchdepid", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  ecode2 = SWIG_AsValDepId(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "DepId","matchdepid", 2, argv[0] ));
  } 
  arg2 = (DepId)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchdepid", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchdepid", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchdepid", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  result = (Selection *)Pool_matchdepid(arg1,arg2,arg3,arg4,arg5);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_matchsolvable(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  Id arg4 ;
  Id arg5 = -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","matchsolvable", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","matchsolvable", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","matchsolvable", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","matchsolvable", 4, argv[2] ));
  } 
  arg4 = (Id)(val4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","matchsolvable", 5, argv[3] ));
    } 
    arg5 = (Id)(val5);
  }
  result = (Selection *)Pool_matchsolvable(arg1,arg2,arg3,arg4,arg5);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_get_considered_list(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","get_considered_list", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_get_considered_list(arg1);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_get_disabled_list(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","get_disabled_list", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_get_disabled_list(arg1);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_considered_list(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_considered_list", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      int v;
      int e = SWIG_AsVal_int(*o, &v);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_TypeError, "list in argument 2 must contain only " "integers");
      queue_push(&arg2, v);
    }
  }
  
  Pool_set_considered_list(arg1,arg2);
  {
    queue_free(&arg2);
  }
  return Qnil;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_set_disabled_list(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","set_disabled_list", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      int v;
      int e = SWIG_AsVal_int(*o, &v);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_TypeError, "list in argument 2 must contain only " "integers");
      queue_push(&arg2, v);
    }
  }
  
  Pool_set_disabled_list(arg1,arg2);
  {
    queue_free(&arg2);
  }
  return Qnil;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_setpooljobs(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","setpooljobs", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      Job * obj;
      int e = SWIG_ConvertPtr(*o, (void **)&obj, SWIGTYPE_p_Job, 0 | 0);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_ArgError(e), "list in argument 2 must contain only ""Job *");
      queue_push2(&arg2, obj->how, obj->what);
    }
  }
  
  Pool_setpooljobs(arg1,arg2);
  {
    queue_free(&arg2);
  }
  return Qnil;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Pool_getpooljobs(int argc, VALUE *argv, VALUE self) {
  Pool *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Pool *","getpooljobs", 1, self )); 
  }
  arg1 = (Pool *)(argp1);
  result = Pool_getpooljobs(arg1);
  {
    int i;
    int cnt = (&result)->count / 2;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 2)
    {
      Id id = *idp;
#define result resultx
      Job * result = new_Job(arg1, id, idp[1]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Job, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassRepo;

SWIGINTERN VALUE
_wrap_Repo_pool_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","pool", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_name_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","name", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (char *)(char *) ((arg1)->name);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_priority_set(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","priority", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","priority", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->priority = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_priority_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","priority", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (int) ((arg1)->priority);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_subpriority_set(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","subpriority", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","subpriority", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  if (arg1) (arg1)->subpriority = arg2;
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_subpriority_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","subpriority", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (int) ((arg1)->subpriority);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_nsolvables_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","nsolvables", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (int)(int) ((arg1)->nsolvables);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_free(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","free", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","free", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  Repo_free(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Repo.empty

  call-seq:
    empty(reuseids=false)

Check if Repo is empty.
*/
SWIGINTERN VALUE
_wrap_Repo_empty(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","empty", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","empty", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  Repo_empty(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_isemptyq___(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","isempty", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (bool)Repo_isempty(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_appdata_set(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  AppObjectPtr arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","appdata", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  {
    arg2 = (void *)argv[0];
  }
  Repo_appdata_set(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_appdata_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  AppObjectPtr result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","appdata", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (AppObjectPtr)Repo_appdata_get(arg1);
  {
    vresult = (VALUE)result;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_solv__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_solv", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_solv", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_solv", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_solv__SWIG_0(arg1,(char const *)arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_solv__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_solv", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_solv", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_solv", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_solv__SWIG_1(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE _wrap_Repo_add_solv(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[4];
  int ii;
  
  argc = nargs + 1;
  argv[0] = self;
  if (argc > 4) SWIG_fail;
  for (ii = 1; (ii < argc); ++ii) {
    argv[ii] = args[ii-1];
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v = 0;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Repo, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsValSolvFpPtr(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_Repo_add_solv__SWIG_1(nargs, args, self);
        }
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Repo_add_solv__SWIG_1(nargs, args, self);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v = 0;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Repo, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        if (argc <= 2) {
          return _wrap_Repo_add_solv__SWIG_0(nargs, args, self);
        }
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Repo_add_solv__SWIG_0(nargs, args, self);
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 4, "add_solv", 
    "    bool add_solv(char const *name, int flags)\n"
    "    bool add_solv(FILE *fp, int flags)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_solvable(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_solvable", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (XSolvable *)Repo_add_solvable(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_rpmdb(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_rpmdb", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_rpmdb", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (bool)Repo_add_rpmdb(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_rpmdb_reffp(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_rpmdb_reffp", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_rpmdb_reffp", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_rpmdb_reffp", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_rpmdb_reffp(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_rpm(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_rpm", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_rpm", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_rpm", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (XSolvable *)Repo_add_rpm(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_rpmdb_pubkeys(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_rpmdb_pubkeys", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_rpmdb_pubkeys", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (bool)Repo_add_rpmdb_pubkeys(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_pubkey(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_pubkey", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_pubkey", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_pubkey", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (XSolvable *)Repo_add_pubkey(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_keyring(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_keyring", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_keyring", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_keyring", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_keyring(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_keydir(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_keydir", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_keydir", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","add_keydir", 3, argv[1] ));
  }
  arg3 = (char *)(buf3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","add_keydir", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (bool)Repo_add_keydir(arg1,(char const *)arg2,(char const *)arg3,arg4);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_rpmmd(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_rpmmd", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_rpmmd", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","add_rpmmd", 3, argv[1] ));
  }
  arg3 = (char *)(buf3);
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","add_rpmmd", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (bool)Repo_add_rpmmd(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_repomdxml(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_repomdxml", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_repomdxml", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_repomdxml", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_repomdxml(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_updateinfoxml(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_updateinfoxml", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_updateinfoxml", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_updateinfoxml", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_updateinfoxml(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_deltainfoxml(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_deltainfoxml", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_deltainfoxml", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_deltainfoxml", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_deltainfoxml(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_debdb(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_debdb", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_debdb", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (bool)Repo_add_debdb(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_debpackages(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_debpackages", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_debpackages", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_debpackages", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_debpackages(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_deb(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_deb", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_deb", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_deb", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (XSolvable *)Repo_add_deb(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_susetags(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  Id arg3 ;
  char *arg4 = 0 ;
  int arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 3) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_susetags", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_susetags", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","add_susetags", 3, argv[1] ));
  } 
  arg3 = (Id)(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","add_susetags", 4, argv[2] ));
  }
  arg4 = (char *)(buf4);
  if (argc > 3) {
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","add_susetags", 5, argv[3] ));
    } 
    arg5 = (int)(val5);
  }
  result = (bool)Repo_add_susetags(arg1,arg2,arg3,(char const *)arg4,arg5);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return vresult;
fail:
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_content(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_content", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_content", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_content", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_content(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_products(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_products", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_products", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_products", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_products(arg1,(char const *)arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_mdk(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_mdk", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_mdk", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_mdk", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_mdk(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_mdk_info(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_mdk_info", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_mdk_info", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_mdk_info", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_mdk_info(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_arch_repo(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_arch_repo", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_arch_repo", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_arch_repo", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_arch_repo(arg1,arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_arch_local(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_arch_local", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_arch_local", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_arch_local", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (bool)Repo_add_arch_local(arg1,(char const *)arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_arch_pkg(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  int arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_arch_pkg", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_arch_pkg", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  if (argc > 1) {
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","add_arch_pkg", 3, argv[1] ));
    } 
    arg3 = (int)(val3);
  }
  result = (XSolvable *)Repo_add_arch_pkg(arg1,(char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_internalize(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","internalize", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  Repo_internalize(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_write(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","write", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","write", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  result = (bool)Repo_write(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_write_first_repodata(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  FILE *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","write_first_repodata", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","write_first_repodata", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  result = (bool)Repo_write_first_repodata(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_Dataiterator(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","Dataiterator", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","Dataiterator", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Dataiterator", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (Dataiterator *)Repo_Dataiterator(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_Dataiterator_meta(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Id arg2 ;
  char *arg3 = 0 ;
  int arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Dataiterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","Dataiterator_meta", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Dataiterator_meta", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  if (argc > 1) {
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","Dataiterator_meta", 3, argv[1] ));
    }
    arg3 = (char *)(buf3);
  }
  if (argc > 2) {
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","Dataiterator_meta", 4, argv[2] ));
    } 
    arg4 = (int)(val4);
  }
  result = (Dataiterator *)Repo_Dataiterator_meta(arg1,arg2,(char const *)arg3,arg4);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dataiterator, SWIG_POINTER_OWN |  0 );
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_id_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","id", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Id)Repo_id_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_solvables_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","solvables", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Repo_solvable_iterator *)Repo_solvables_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo_solvable_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_meta_get(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Datapos *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","meta", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Datapos *)Repo_meta_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datapos, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_solvables_iter(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Repo_solvable_iterator *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","solvables_iter", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (Repo_solvable_iterator *)Repo_solvables_iter(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo_solvable_iterator, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_add_repodata(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  XRepodata *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","add_repodata", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_repodata", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (XRepodata *)Repo_add_repodata(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRepodata, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_create_stubs(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","create_stubs", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  Repo_create_stubs(arg1);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_iscontiguousq___(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","iscontiguous", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (bool)Repo_iscontiguous(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_first_repodata(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XRepodata *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","first_repodata", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (XRepodata *)Repo_first_repodata(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRepodata, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_Selection(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Selection *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","Selection", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Selection", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = (Selection *)Repo_Selection(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Selection, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_find_pubkey(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","find_pubkey", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","find_pubkey", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  result = (XSolvable *)Repo_find_pubkey(arg1,(char const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_createshadow(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  Repo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","createshadow", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","createshadow", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  result = (Repo *)Repo_createshadow(arg1,(char const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Repo, 0 |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_moveshadow(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","moveshadow", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      int v;
      int e = SWIG_AsVal_int(*o, &v);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_TypeError, "list in argument 2 must contain only " "integers");
      queue_push(&arg2, v);
    }
  }
  
  Repo_moveshadow(arg1,arg2);
  {
    queue_free(&arg2);
  }
  return Qnil;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


/*
  Document-method: Solv::Repo.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_Repo___eq__(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Repo *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","__eq__", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Repo *","__eq__", 2, argv[0] )); 
  }
  arg2 = (Repo *)(argp2);
  result = (bool)Repo___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo___ne__(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  Repo *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","__ne__", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Repo *","__ne__", 2, argv[0] )); 
  }
  arg2 = (Repo *)(argp2);
  result = (bool)Repo___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo_to_s(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","__str__", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (char *)Repo___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Repo___repr__(int argc, VALUE *argv, VALUE self) {
  Repo *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Repo *","__repr__", 1, self )); 
  }
  arg1 = (Repo *)(argp1);
  result = (char *)Repo___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassDecision;

SWIGINTERN VALUE
_wrap_Decision_solv_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","solv", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_p_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","p", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (Id)(Id) ((arg1)->p);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_reason_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","reason", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (int)(int) ((arg1)->reason);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_infoid_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","infoid", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (Id)(Id) ((arg1)->infoid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Decision(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  int arg3 ;
  Id arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  Decision *result = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","Decision", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Decision", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Decision", 3, argv[2] ));
  } 
  arg3 = (int)(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","Decision", 4, argv[3] ));
  } 
  arg4 = (Id)(val4);
  result = (Decision *)new_Decision(arg1,arg2,arg3,arg4);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_rule_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XRule *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","rule", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (XRule *)Decision_rule_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_solvable_get(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","solvable", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (XSolvable *)Decision_solvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_info(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Ruleinfo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","info", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (Ruleinfo *)Decision_info(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Ruleinfo, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_allinfos(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","allinfos", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = Decision_allinfos(arg1);
  {
    int i;
    int cnt = (&result)->count / 4;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Ruleinfo, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_reasonstr(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","reasonstr", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","reasonstr", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  result = (char *)Decision_reasonstr(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decision_to_s(int argc, VALUE *argv, VALUE self) {
  Decision *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decision, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decision *","__str__", 1, self )); 
  }
  arg1 = (Decision *)(argp1);
  result = (char *)Decision___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Decision(void *self) {
    Decision *arg1 = (Decision *)self;
    free((char *) arg1);
}

static swig_class SwigClassDecisionset;

SWIGINTERN VALUE
_wrap_Decisionset_solv_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","solv", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_p_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","p", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Id)(Id) ((arg1)->p);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_reason_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","reason", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (int)(int) ((arg1)->reason);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_infoid_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","infoid", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Id)(Id) ((arg1)->infoid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_bits_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","bits", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (int)(int) ((arg1)->bits);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_type_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","type", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (int)(int) ((arg1)->type);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_dep_id_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","dep_id", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Id)(Id) ((arg1)->dep_id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Decisionset(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Decisionset *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","Decisionset", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  result = (Decisionset *)new_Decisionset(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void delete_Decisionset(Decisionset *self){
    queue_free(&self->decisionlistq);
    solv_free(self);
  }
SWIGINTERN void
free_Decisionset(void *self) {
    Decisionset *arg1 = (Decisionset *)self;
    delete_Decisionset(arg1);
}

SWIGINTERN VALUE
_wrap_Decisionset_info(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Ruleinfo *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","info", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Ruleinfo *)Decisionset_info(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Ruleinfo, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_dep_get(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","dep", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (Dep *)Decisionset_dep_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_solvables(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","solvables", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = Decisionset_solvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->solv->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_decisions(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","decisions", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = Decisionset_decisions(arg1);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_reasonstr(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","reasonstr", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","reasonstr", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  result = (char *)Decisionset_reasonstr(arg1,arg2);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Decisionset_to_s(int argc, VALUE *argv, VALUE self) {
  Decisionset *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Decisionset, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Decisionset *","__str__", 1, self )); 
  }
  arg1 = (Decisionset *)(argp1);
  result = (char *)Decisionset___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassSolver;

SWIGINTERN VALUE
_wrap_Solver_pool_get(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","pool", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void delete_Solver(Solver *self){
    solver_free(self);
  }
SWIGINTERN void
free_Solver(void *self) {
    Solver *arg1 = (Solver *)self;
    delete_Solver(arg1);
}

SWIGINTERN VALUE
_wrap_Solver_set_flag(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","set_flag", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","set_flag", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","set_flag", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  result = (int)Solver_set_flag(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_flag(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_flag", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","get_flag", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  result = (int)Solver_get_flag(arg1,arg2);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_solve(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Queue arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  {
    queue_init(&arg2);
  }
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","solve", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  {
    int size, i;
    VALUE *o, ary;
    ary = rb_Array(argv[0]);
    size = RARRAY_LEN(ary);
    i = 0;
    o = RARRAY_PTR(ary);
    for (i = 0; i < size; i++, o++) {
      Job * obj;
      int e = SWIG_ConvertPtr(*o, (void **)&obj, SWIGTYPE_p_Job, 0 | 0);
      if (!SWIG_IsOK(e))
      SWIG_exception_fail(SWIG_ArgError(e), "list in argument 2 must contain only ""Job *");
      queue_push2(&arg2, obj->how, obj->what);
    }
  }
  
  result = Solver_solve(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      Problem * result = new_Problem(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Problem, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  {
    queue_free(&arg2);
  }
  return vresult;
fail:
  {
    queue_free(&arg2);
  }
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_transaction(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Transaction *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","transaction", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  result = (Transaction *)Solver_transaction(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Transaction, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_describe_decision(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  XRule **arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  XRule *temp3 ;
  int result;
  VALUE vresult = Qnil;
  
  arg3 = &temp3;
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","describe_decision", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","describe_decision", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (int)Solver_describe_decision(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(*arg3), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 ), 0);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_describe_weakdep_decision_raw(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","describe_weakdep_decision_raw", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","describe_weakdep_decision_raw", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = Solver_describe_weakdep_decision_raw(arg1,arg2);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_alternatives_count(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","alternatives_count", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  result = (int)Solver_alternatives_count(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_alternative(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Alternative *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_alternative", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","get_alternative", 2, argv[0] ));
  } 
  arg2 = (Id)(val2);
  result = (Alternative *)Solver_get_alternative(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Alternative, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_alternatives(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","alternatives", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  result = Solver_alternatives(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      Alternative * result = Solver_get_alternative(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Alternative, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_write_testcase(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","write_testcase", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","write_testcase", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  result = (bool)Solver_write_testcase(arg1,(char const *)arg2);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_raw_decisions(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","raw_decisions", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","raw_decisions", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = Solver_raw_decisions(arg1,arg2);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_all_decisions(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","all_decisions", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","all_decisions", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = Solver_all_decisions(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 3)
    {
      Id id = *idp;
#define result resultx
      Decision * result = new_Decision(arg1, id, idp[1], idp[2]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_decision(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  Decision *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_decision", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","get_decision", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (Decision *)Solver_get_decision(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_learnt(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_learnt", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","get_learnt", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = Solver_get_learnt(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XRule * result = new_XRule(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_decisionlist(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_decisionlist", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","get_decisionlist", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = Solver_get_decisionlist(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 3)
    {
      Id id = *idp;
#define result resultx
      Decision * result = new_Decision(arg1, id, idp[1], idp[2]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_recommended(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_recommended", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","get_recommended", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  result = Solver_get_recommended(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solver_get_suggested(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","get_suggested", 1, self )); 
  }
  arg1 = (Solver *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","get_suggested", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  result = Solver_get_suggested(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassChksum;

SWIGINTERN VALUE
_wrap_new_Chksum__SWIG_0(int argc, VALUE *argv, VALUE self) {
  Id arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  Chksum *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Id","Chksum", 1, argv[0] ));
  } 
  arg1 = (Id)(val1);
  result = (Chksum *)new_Chksum__SWIG_0(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Chksum__SWIG_1(int argc, VALUE *argv, VALUE self) {
  Id arg1 ;
  char *arg2 = 0 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  Chksum *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Id","Chksum", 1, argv[0] ));
  } 
  arg1 = (Id)(val1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Chksum", 2, argv[1] ));
  }
  arg2 = (char *)(buf2);
  result = (Chksum *)new_Chksum__SWIG_1(arg1,(char const *)arg2);
  DATA_PTR(self) = result;
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return self;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE _wrap_new_Chksum(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[2];
  int ii;
  
  argc = nargs;
  if (argc > 2) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 1) {
    int _v = 0;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_Chksum__SWIG_0(nargs, args, self);
    }
  }
  if (argc == 2) {
    int _v = 0;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_Chksum__SWIG_1(nargs, args, self);
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 2, "Chksum.new", 
    "    Chksum.new(Id type)\n"
    "    Chksum.new(Id type, char const *hex)\n");
  
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_from_bin(int argc, VALUE *argv, VALUE self) {
  Id arg1 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  int val1 ;
  int ecode1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "Id","Chksum_from_bin", 1, argv[0] ));
  } 
  arg1 = (Id)(val1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, &size2, &alloc2);
  if (buf2 && size2)
  size2--;
  
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "const char *","Chksum_from_bin", 2, argv[1] ));
    
  }
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  result = (Chksum *)Chksum_from_bin(arg1,(unsigned char const *)arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN void delete_Chksum(Chksum *self){
    solv_chksum_free(self, 0);
  }
SWIGINTERN void
free_Chksum(void *self) {
    Chksum *arg1 = (Chksum *)self;
    delete_Chksum(arg1);
}

SWIGINTERN VALUE
_wrap_Chksum_type_get(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","type", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = (Id)Chksum_type_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_add(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","add", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, &size2, &alloc2);
  if (buf2 && size2)
  size2--;
  
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "const char *","add", 2, argv[0] ));
    
  }
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  Chksum_add(arg1,(unsigned char const *)arg2,arg3);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  {
    return self;
  }    return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_add_fp(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  FILE *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  FILE *val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","add_fp", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  ecode2 = SWIG_AsValSolvFpPtr(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "FILE *","add_fp", 2, argv[0] ));
  } 
  arg2 = (FILE *)(val2);
  Chksum_add_fp(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_add_fd(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","add_fd", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_fd", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  Chksum_add_fd(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_add_stat(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  char *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","add_stat", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","add_stat", 2, argv[0] ));
  }
  arg2 = (char *)(buf2);
  Chksum_add_stat(arg1,(char const *)arg2);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_add_fstat(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","add_fstat", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","add_fstat", 2, argv[0] ));
  } 
  arg2 = (int)(val2);
  Chksum_add_fstat(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_raw(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  BinaryBlob result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","raw", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = Chksum_raw(arg1);
  vresult = SWIG_FromCharPtrAndSize((&result)->data, (&result)->len);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_hex(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","hex", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = (char *)Chksum_hex(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_typestr(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","typestr", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = (char *)Chksum_typestr(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::Chksum.==

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

Equality comparison operator.
*/
SWIGINTERN VALUE
_wrap_Chksum___eq__(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  Chksum *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","__eq__", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Chksum *","__eq__", 2, argv[0] )); 
  }
  arg2 = (Chksum *)(argp2);
  result = (bool)Chksum___eq__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum___ne__(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  Chksum *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","__ne__", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Chksum *","__ne__", 2, argv[0] )); 
  }
  arg2 = (Chksum *)(argp2);
  result = (bool)Chksum___ne__(arg1,arg2);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum_to_s(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","__str__", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = (char *)Chksum___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Chksum___repr__(int argc, VALUE *argv, VALUE self) {
  Chksum *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Chksum *","__repr__", 1, self )); 
  }
  arg1 = (Chksum *)(argp1);
  result = (char *)Chksum___repr__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  free((char*)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassSolvsig;

SWIGINTERN VALUE
_wrap_Solvsig_htype_get(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","htype", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  result = (Id)(Id) ((arg1)->htype);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solvsig_created_get(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","created", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  result = (unsigned int)(unsigned int) ((arg1)->created);
  vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solvsig_expires_get(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","expires", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  result = (unsigned int)(unsigned int) ((arg1)->expires);
  vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solvsig_keyid_get(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","keyid", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  result = (char *)(char *) ((arg1)->keyid);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Solvsig(int argc, VALUE *argv, VALUE self) {
  FILE *arg1 = 0 ;
  FILE *val1 ;
  int ecode1 = 0 ;
  Solvsig *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsValSolvFpPtr(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "FILE *","Solvsig", 1, argv[0] ));
  } 
  arg1 = (FILE *)(val1);
  result = (Solvsig *)new_Solvsig(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN void delete_Solvsig(Solvsig *self){
    solvsig_free(self);
  }
SWIGINTERN void
free_Solvsig(void *self) {
    Solvsig *arg1 = (Solvsig *)self;
    delete_Solvsig(arg1);
}

SWIGINTERN VALUE
_wrap_Solvsig_Chksum(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Chksum *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","Chksum", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  result = (Chksum *)Solvsig_Chksum(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Chksum, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solvsig_verify(int argc, VALUE *argv, VALUE self) {
  Solvsig *arg1 = 0 ;
  Repo *arg2 = 0 ;
  Chksum *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solvsig, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solvsig *","verify", 1, self )); 
  }
  arg1 = (Solvsig *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Repo, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Repo *","verify", 2, argv[0] )); 
  }
  arg2 = (Repo *)(argp2);
  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_Chksum, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "Chksum *","verify", 3, argv[1] )); 
  }
  arg3 = (Chksum *)(argp3);
  result = (XSolvable *)Solvsig_verify(arg1,arg2,arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassSolvFp;

SWIGINTERN void delete_SolvFp(SolvFp *self){
    if (self->fp)
      fclose(self->fp);
    free(self);
  }
SWIGINTERN void
free_SolvFp(void *self) {
    SolvFp *arg1 = (SolvFp *)self;
    delete_SolvFp(arg1);
}

SWIGINTERN VALUE
_wrap_SolvFp_fileno(int argc, VALUE *argv, VALUE self) {
  SolvFp *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolvFp, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolvFp *","fileno", 1, self )); 
  }
  arg1 = (SolvFp *)(argp1);
  result = (int)SolvFp_fileno(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


/*
  Document-method: Solv::SolvFp.dup

  call-seq:
    dup -> int

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


SWIGINTERN VALUE
_wrap_SolvFp_write(int argc, VALUE *argv, VALUE self) {
  SolvFp *arg1 = 0 ;
  unsigned char *arg2 = 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolvFp, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolvFp *","write", 1, self )); 
  }
  arg1 = (SolvFp *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, &size2, &alloc2);
  if (buf2 && size2)
  size2--;
  
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "const char *","write", 2, argv[0] ));
    
  }
  arg2 = (unsigned char *)buf2;
  arg3 = size2;
  result = (bool)SolvFp_write(arg1,(unsigned char const *)arg2,arg3);
  vresult = SWIG_From_bool((bool)(result));
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SolvFp_flush(int argc, VALUE *argv, VALUE self) {
  SolvFp *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolvFp, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolvFp *","flush", 1, self )); 
  }
  arg1 = (SolvFp *)(argp1);
  result = (bool)SolvFp_flush(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SolvFp_close(int argc, VALUE *argv, VALUE self) {
  SolvFp *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolvFp, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolvFp *","close", 1, self )); 
  }
  arg1 = (SolvFp *)(argp1);
  result = (bool)SolvFp_close(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_SolvFp_cloexec(int argc, VALUE *argv, VALUE self) {
  SolvFp *arg1 = 0 ;
  bool arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SolvFp, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SolvFp *","cloexec", 1, self )); 
  }
  arg1 = (SolvFp *)(argp1);
  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","cloexec", 2, argv[0] ));
  } 
  arg2 = (bool)(val2);
  SolvFp_cloexec(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_xfopen(int argc, VALUE *argv, VALUE self) {
  char *arg1 = 0 ;
  char *arg2 = 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  SolvFp *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","solvfp_xfopen", 1, argv[0] ));
  }
  arg1 = (char *)(buf1);
  if (argc > 1) {
    res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","solvfp_xfopen", 2, argv[1] ));
    }
    arg2 = (char *)(buf2);
  }
  result = (SolvFp *)solvfp_xfopen((char const *)arg1,(char const *)arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SolvFp, SWIG_POINTER_OWN |  0 );
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return vresult;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return Qnil;
}


SWIGINTERN VALUE
_wrap_xfopen_fd(int argc, VALUE *argv, VALUE self) {
  char *arg1 = 0 ;
  int arg2 ;
  char *arg3 = 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  SolvFp *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 3)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","solvfp_xfopen_fd", 1, argv[0] ));
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","solvfp_xfopen_fd", 2, argv[1] ));
  } 
  arg2 = (int)(val2);
  if (argc > 2) {
    res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","solvfp_xfopen_fd", 3, argv[2] ));
    }
    arg3 = (char *)(buf3);
  }
  result = (SolvFp *)solvfp_xfopen_fd((char const *)arg1,arg2,(char const *)arg3);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SolvFp, SWIG_POINTER_OWN |  0 );
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return vresult;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return Qnil;
}


static swig_class SwigClassProblem;

SWIGINTERN VALUE
_wrap_Problem_solv_get(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","solv", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_id_get(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","id", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Problem(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Problem *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","Problem", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Problem", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (Problem *)new_Problem(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_findproblemrule(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XRule *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","findproblemrule", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = (XRule *)Problem_findproblemrule(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_findallproblemrules(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","findallproblemrules", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","findallproblemrules", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = Problem_findallproblemrules(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XRule * result = new_XRule(arg1->solv, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_solution_count(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","solution_count", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = (int)Problem_solution_count(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_solutions(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","solutions", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = Problem_solutions(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      Solution * result = new_Solution(arg1, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solution, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_get_learnt(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","get_learnt", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = Problem_get_learnt(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XRule * result = new_XRule(arg1->solv, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_get_decisionlist(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","get_decisionlist", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = Problem_get_decisionlist(arg1);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decision, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_get_decisionsetlist(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","get_decisionsetlist", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = Problem_get_decisionsetlist(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Decisionset, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Problem_to_s(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","__str__", 1, self )); 
  }
  arg1 = (Problem *)(argp1);
  result = (char *)Problem___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Problem(void *self) {
    Problem *arg1 = (Problem *)self;
    free((char *) arg1);
}

static swig_class SwigClassSolution;

SWIGINTERN VALUE
_wrap_Solution_solv_get(int argc, VALUE *argv, VALUE self) {
  Solution *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solution, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solution *","solv", 1, self )); 
  }
  arg1 = (Solution *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solution_problemid_get(int argc, VALUE *argv, VALUE self) {
  Solution *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solution, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solution *","problemid", 1, self )); 
  }
  arg1 = (Solution *)(argp1);
  result = (Id)(Id) ((arg1)->problemid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solution_id_get(int argc, VALUE *argv, VALUE self) {
  Solution *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solution, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solution *","id", 1, self )); 
  }
  arg1 = (Solution *)(argp1);
  result = (Id)(Id) ((arg1)->id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Solution(int argc, VALUE *argv, VALUE self) {
  Problem *arg1 = 0 ;
  Id arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Solution *result = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Problem, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Problem *","Solution", 1, argv[0] )); 
  }
  arg1 = (Problem *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Solution", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  result = (Solution *)new_Solution(arg1,arg2);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solution_element_count(int argc, VALUE *argv, VALUE self) {
  Solution *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solution, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solution *","element_count", 1, self )); 
  }
  arg1 = (Solution *)(argp1);
  result = (int)Solution_element_count(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solution_elements(int argc, VALUE *argv, VALUE self) {
  Solution *arg1 = 0 ;
  bool arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solution, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solution *","elements", 1, self )); 
  }
  arg1 = (Solution *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_bool(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","elements", 2, argv[0] ));
    } 
    arg2 = (bool)(val2);
  }
  result = Solution_elements(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 3;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solutionelement, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Solution(void *self) {
    Solution *arg1 = (Solution *)self;
    free((char *) arg1);
}

static swig_class SwigClassSolutionelement;

SWIGINTERN VALUE
_wrap_Solutionelement_solv_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","solv", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_problemid_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","problemid", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (Id)(Id) ((arg1)->problemid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_solutionid_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","solutionid", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (Id)(Id) ((arg1)->solutionid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_type_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","type", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (Id)(Id) ((arg1)->type);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_Solutionelement(int argc, VALUE *argv, VALUE self) {
  Solver *arg1 = 0 ;
  Id arg2 ;
  Id arg3 ;
  Id arg4 ;
  Id arg5 ;
  Id arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  Solutionelement *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Solver, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solver *","Solutionelement", 1, argv[0] )); 
  }
  arg1 = (Solver *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "Id","Solutionelement", 2, argv[1] ));
  } 
  arg2 = (Id)(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","Solutionelement", 3, argv[2] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "Id","Solutionelement", 4, argv[3] ));
  } 
  arg4 = (Id)(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","Solutionelement", 5, argv[4] ));
  } 
  arg5 = (Id)(val5);
  ecode6 = SWIG_AsVal_int(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "Id","Solutionelement", 6, argv[5] ));
  } 
  arg6 = (Id)(val6);
  result = (Solutionelement *)new_Solutionelement(arg1,arg2,arg3,arg4,arg5,arg6);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_str(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","str", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (char *)Solutionelement_str(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_to_s(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","__str__", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (char *)Solutionelement___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_replaceelements(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","replaceelements", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = Solutionelement_replaceelements(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solutionelement, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_illegalreplace(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","illegalreplace", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (int)Solutionelement_illegalreplace(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_solvable_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","solvable", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (XSolvable *)Solutionelement_solvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_replacement_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","replacement", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (XSolvable *)Solutionelement_replacement_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_jobidx_get(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","jobidx", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (int)Solutionelement_jobidx_get(arg1);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Solutionelement_Job(int argc, VALUE *argv, VALUE self) {
  Solutionelement *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Job *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Solutionelement, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Solutionelement *","Job", 1, self )); 
  }
  arg1 = (Solutionelement *)(argp1);
  result = (Job *)Solutionelement_Job(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Job, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_Solutionelement(void *self) {
    Solutionelement *arg1 = (Solutionelement *)self;
    free((char *) arg1);
}

static swig_class SwigClassAlternative;

SWIGINTERN VALUE
_wrap_Alternative_solv_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Solver *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","solv", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (Solver *)(Solver *) ((arg1)->solv);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Solver, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_type_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","type", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (Id)(Id) ((arg1)->type);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_dep_id_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","dep_id", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (Id)(Id) ((arg1)->dep_id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_chosen_id_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","chosen_id", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (Id)(Id) ((arg1)->chosen_id);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_level_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","level", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (int)(int) ((arg1)->level);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void delete_Alternative(Alternative *self){
    queue_free(&self->choices);
    solv_free(self);
  }
SWIGINTERN void
free_Alternative(void *self) {
    Alternative *arg1 = (Alternative *)self;
    delete_Alternative(arg1);
}

SWIGINTERN VALUE
_wrap_Alternative_chosen_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","chosen", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (XSolvable *)Alternative_chosen_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_rule_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XRule *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","rule", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (XRule *)Alternative_rule_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XRule, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_depsolvable_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","depsolvable", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (XSolvable *)Alternative_depsolvable_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_dep_get(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Dep *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","dep", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (Dep *)Alternative_dep_get(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dep, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_choices_raw(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","choices_raw", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = Alternative_choices_raw(arg1);
  {
    int i;
    VALUE o = rb_ary_new2((&result)->count);
    for (i = 0; i < (&result)->count; i++)
    rb_ary_store(o, i, SWIG_From_int((&result)->elements[i]));
    queue_free(&result);
    vresult = o;
  }
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_choices(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","choices", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = Alternative_choices(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->solv->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, 0 |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Alternative_to_s(int argc, VALUE *argv, VALUE self) {
  Alternative *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Alternative, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Alternative *","__str__", 1, self )); 
  }
  arg1 = (Alternative *)(argp1);
  result = (char *)Alternative___str__(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


static swig_class SwigClassTransaction;

SWIGINTERN VALUE
_wrap_Transaction_pool_get(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Pool *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","pool", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = (Pool *)(Pool *) ((arg1)->pool);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pool, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void delete_Transaction(Transaction *self){
    transaction_free(self);
  }
SWIGINTERN void
free_Transaction(void *self) {
    Transaction *arg1 = (Transaction *)self;
    delete_Transaction(arg1);
}

SWIGINTERN VALUE
_wrap_Transaction_isemptyq___(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  bool result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","isempty", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = (bool)Transaction_isempty(arg1);
  vresult = SWIG_From_bool((bool)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_othersolvable(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  XSolvable *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","othersolvable", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","othersolvable", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = (XSolvable *)Transaction_othersolvable(arg1,arg2);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_allothersolvables(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","allothersolvables", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","allothersolvables", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  result = Transaction_allothersolvables(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_classify(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","classify", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","classify", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  result = Transaction_classify(arg1,arg2);
  {
    int i;
    int cnt = (&result)->count / 4;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    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]);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TransactionClass, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_newpackages(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","newpackages", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = Transaction_newpackages(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_keptpackages(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","keptpackages", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = Transaction_keptpackages(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_newsolvables(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","newsolvables", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = Transaction_newsolvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_keptsolvables(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","keptsolvables", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = Transaction_keptsolvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_steps(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","steps", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = Transaction_steps(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_steptype(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  XSolvable *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","steptype", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XSolvable, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "XSolvable *","steptype", 2, argv[0] )); 
  }
  arg2 = (XSolvable *)(argp2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","steptype", 3, argv[1] ));
  } 
  arg3 = (int)(val3);
  result = (int)Transaction_steptype(arg1,arg2,arg3);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_calc_installsizechange(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  long long result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","calc_installsizechange", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  result = (long long)Transaction_calc_installsizechange(arg1);
  vresult = SWIG_From_long_SS_long((long long)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_Transaction_order(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  int arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 0) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","order", 1, self )); 
  }
  arg1 = (Transaction *)(argp1);
  if (argc > 0) {
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","order", 2, argv[0] ));
    } 
    arg2 = (int)(val2);
  }
  Transaction_order(arg1,arg2);
  return Qnil;
fail:
  return Qnil;
}


static swig_class SwigClassTransactionClass;

SWIGINTERN VALUE
_wrap_TransactionClass_transaction_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Transaction *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","transaction", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (Transaction *)(Transaction *) ((arg1)->transaction);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Transaction, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_type_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","type", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (Id)(Id) ((arg1)->type);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_fromid_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","fromid", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (Id)(Id) ((arg1)->fromid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_toid_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Id result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","toid", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (Id)(Id) ((arg1)->toid);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_count_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","count", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (int)(int) ((arg1)->count);
  vresult = SWIG_From_int((int)(result));
  return vresult;
fail:
  return Qnil;
}


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


SWIGINTERN VALUE
_wrap_new_TransactionClass(int argc, VALUE *argv, VALUE self) {
  Transaction *arg1 = 0 ;
  int arg2 ;
  Id arg3 ;
  int arg4 ;
  Id arg5 ;
  Id arg6 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int val4 ;
  int ecode4 = 0 ;
  int val5 ;
  int ecode5 = 0 ;
  int val6 ;
  int ecode6 = 0 ;
  TransactionClass *result = 0 ;
  
  if ((argc < 6) || (argc > 6)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Transaction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Transaction *","TransactionClass", 1, argv[0] )); 
  }
  arg1 = (Transaction *)(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","TransactionClass", 2, argv[1] ));
  } 
  arg2 = (int)(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "Id","TransactionClass", 3, argv[2] ));
  } 
  arg3 = (Id)(val3);
  ecode4 = SWIG_AsVal_int(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","TransactionClass", 4, argv[3] ));
  } 
  arg4 = (int)(val4);
  ecode5 = SWIG_AsVal_int(argv[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "Id","TransactionClass", 5, argv[4] ));
  } 
  arg5 = (Id)(val5);
  ecode6 = SWIG_AsVal_int(argv[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "Id","TransactionClass", 6, argv[5] ));
  } 
  arg6 = (Id)(val6);
  result = (TransactionClass *)new_TransactionClass(arg1,arg2,arg3,arg4,arg5,arg6);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_solvables(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Queue result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","solvables", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = TransactionClass_solvables(arg1);
  {
    int i;
    int cnt = (&result)->count / 1;
    Id *idp = (&result)->elements;
    VALUE o = rb_ary_new2(cnt);
    for (i = 0; i < cnt; i++, idp += 1)
    {
      Id id = *idp;
#define result resultx
      XSolvable * result = new_XSolvable(arg1->transaction->pool, id);
      vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XSolvable, SWIG_POINTER_OWN |  0 );
      rb_ary_store(o, i, vresult);
#undef result
    }
    queue_free(&result);
    vresult = o;
  }
  
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_fromstr_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","fromstr", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (char *)TransactionClass_fromstr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN VALUE
_wrap_TransactionClass_tostr_get(int argc, VALUE *argv, VALUE self) {
  TransactionClass *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TransactionClass, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TransactionClass *","tostr", 1, self )); 
  }
  arg1 = (TransactionClass *)(argp1);
  result = (char *)TransactionClass_tostr_get(arg1);
  vresult = SWIG_FromCharPtr((const char *)result);
  return vresult;
fail:
  return Qnil;
}


SWIGINTERN void
free_TransactionClass(void *self) {
    TransactionClass *arg1 = (TransactionClass *)self;
    free((char *) arg1);
}


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

static swig_type_info _swigt__p_Alternative = {"_p_Alternative", "Alternative *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Chksum = {"_p_Chksum", "Chksum *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Dataiterator = {"_p_Dataiterator", "Dataiterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Datamatch = {"_p_Datamatch", "Datamatch *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Datapos = {"_p_Datapos", "Datapos *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Decision = {"_p_Decision", "Decision *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Decisionset = {"_p_Decisionset", "Decisionset *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Dep = {"_p_Dep", "Dep *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Job = {"_p_Job", "Job *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Pool = {"_p_Pool", "Pool *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Pool_repo_iterator = {"_p_Pool_repo_iterator", "Pool_repo_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Pool_solvable_iterator = {"_p_Pool_solvable_iterator", "Pool_solvable_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Problem = {"_p_Problem", "Problem *", 0, 0, (void*)0, 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*)0, 0};
static swig_type_info _swigt__p_Repo_solvable_iterator = {"_p_Repo_solvable_iterator", "Repo_solvable_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Ruleinfo = {"_p_Ruleinfo", "Ruleinfo *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Selection = {"_p_Selection", "Selection *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Solution = {"_p_Solution", "Solution *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Solutionelement = {"_p_Solutionelement", "Solutionelement *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_SolvFp = {"_p_SolvFp", "SolvFp *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Solver = {"_p_Solver", "Solver *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Solvsig = {"_p_Solvsig", "Solvsig *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Transaction = {"_p_Transaction", "Transaction *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_TransactionClass = {"_p_TransactionClass", "TransactionClass *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_XRepodata = {"_p_XRepodata", "XRepodata *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_XRule = {"_p_XRule", "XRule *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_XSolvable = {"_p_XSolvable", "XSolvable *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "Id *|int *", 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_p_void = {"_p_p_void", "AppObjectPtr *|void **", 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_Solvsig,
  &_swigt__p_Transaction,
  &_swigt__p_TransactionClass,
  &_swigt__p_XRepodata,
  &_swigt__p_XRule,
  &_swigt__p_XSolvable,
  &_swigt__p_char,
  &_swigt__p_int,
  &_swigt__p_p_XRule,
  &_swigt__p_p_void,
  &_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_Solvsig[] = {  {&_swigt__p_Solvsig, 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_char[] = {  {&_swigt__p_char, 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_p_XRule[] = {  {&_swigt__p_p_XRule, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 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_Solvsig,
  _swigc__p_Transaction,
  _swigc__p_TransactionClass,
  _swigc__p_XRepodata,
  _swigc__p_XRule,
  _swigc__p_XSolvable,
  _swigc__p_char,
  _swigc__p_int,
  _swigc__p_p_XRule,
  _swigc__p_p_void,
  _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

/*

*/
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT void Init_solv(void) {
  size_t i;
  
  SWIG_InitRuntime();
  mSolv = rb_define_module("Solv");
  
  SWIG_InitializeModule(0);
  for (i = 0; i < swig_module.size; i++) {
    SWIG_define_class(swig_module.types[i]);
  }
  
  SWIG_RubyInitializeTrackings();
  rb_define_const(mSolv, "ID_NULL", SWIG_From_int((int)(ID_NULL)));
  rb_define_const(mSolv, "ID_EMPTY", SWIG_From_int((int)(ID_EMPTY)));
  rb_define_const(mSolv, "SOLVABLE_NAME", SWIG_From_int((int)(SOLVABLE_NAME)));
  rb_define_const(mSolv, "SOLVABLE_ARCH", SWIG_From_int((int)(SOLVABLE_ARCH)));
  rb_define_const(mSolv, "SOLVABLE_EVR", SWIG_From_int((int)(SOLVABLE_EVR)));
  rb_define_const(mSolv, "SOLVABLE_VENDOR", SWIG_From_int((int)(SOLVABLE_VENDOR)));
  rb_define_const(mSolv, "SOLVABLE_PROVIDES", SWIG_From_int((int)(SOLVABLE_PROVIDES)));
  rb_define_const(mSolv, "SOLVABLE_OBSOLETES", SWIG_From_int((int)(SOLVABLE_OBSOLETES)));
  rb_define_const(mSolv, "SOLVABLE_CONFLICTS", SWIG_From_int((int)(SOLVABLE_CONFLICTS)));
  rb_define_const(mSolv, "SOLVABLE_REQUIRES", SWIG_From_int((int)(SOLVABLE_REQUIRES)));
  rb_define_const(mSolv, "SOLVABLE_RECOMMENDS", SWIG_From_int((int)(SOLVABLE_RECOMMENDS)));
  rb_define_const(mSolv, "SOLVABLE_SUGGESTS", SWIG_From_int((int)(SOLVABLE_SUGGESTS)));
  rb_define_const(mSolv, "SOLVABLE_SUPPLEMENTS", SWIG_From_int((int)(SOLVABLE_SUPPLEMENTS)));
  rb_define_const(mSolv, "SOLVABLE_ENHANCES", SWIG_From_int((int)(SOLVABLE_ENHANCES)));
  rb_define_const(mSolv, "RPM_RPMDBID", SWIG_From_int((int)(RPM_RPMDBID)));
  rb_define_const(mSolv, "SOLVABLE_PREREQMARKER", SWIG_From_int((int)(SOLVABLE_PREREQMARKER)));
  rb_define_const(mSolv, "SOLVABLE_FILEMARKER", SWIG_From_int((int)(SOLVABLE_FILEMARKER)));
  rb_define_const(mSolv, "NAMESPACE_INSTALLED", SWIG_From_int((int)(NAMESPACE_INSTALLED)));
  rb_define_const(mSolv, "NAMESPACE_MODALIAS", SWIG_From_int((int)(NAMESPACE_MODALIAS)));
  rb_define_const(mSolv, "NAMESPACE_SPLITPROVIDES", SWIG_From_int((int)(NAMESPACE_SPLITPROVIDES)));
  rb_define_const(mSolv, "NAMESPACE_LANGUAGE", SWIG_From_int((int)(NAMESPACE_LANGUAGE)));
  rb_define_const(mSolv, "NAMESPACE_FILESYSTEM", SWIG_From_int((int)(NAMESPACE_FILESYSTEM)));
  rb_define_const(mSolv, "NAMESPACE_OTHERPROVIDERS", SWIG_From_int((int)(NAMESPACE_OTHERPROVIDERS)));
  rb_define_const(mSolv, "SYSTEM_SYSTEM", SWIG_From_int((int)(SYSTEM_SYSTEM)));
  rb_define_const(mSolv, "ARCH_SRC", SWIG_From_int((int)(ARCH_SRC)));
  rb_define_const(mSolv, "ARCH_NOSRC", SWIG_From_int((int)(ARCH_NOSRC)));
  rb_define_const(mSolv, "ARCH_NOARCH", SWIG_From_int((int)(ARCH_NOARCH)));
  rb_define_const(mSolv, "ARCH_ALL", SWIG_From_int((int)(ARCH_ALL)));
  rb_define_const(mSolv, "ARCH_ANY", SWIG_From_int((int)(ARCH_ANY)));
  rb_define_const(mSolv, "REPOSITORY_SOLVABLES", SWIG_From_int((int)(REPOSITORY_SOLVABLES)));
  rb_define_const(mSolv, "REPOSITORY_DELTAINFO", SWIG_From_int((int)(REPOSITORY_DELTAINFO)));
  rb_define_const(mSolv, "REPOSITORY_EXTERNAL", SWIG_From_int((int)(REPOSITORY_EXTERNAL)));
  rb_define_const(mSolv, "REPOSITORY_KEYS", SWIG_From_int((int)(REPOSITORY_KEYS)));
  rb_define_const(mSolv, "REPOSITORY_LOCATION", SWIG_From_int((int)(REPOSITORY_LOCATION)));
  rb_define_const(mSolv, "REPOKEY_TYPE_VOID", SWIG_From_int((int)(REPOKEY_TYPE_VOID)));
  rb_define_const(mSolv, "REPOKEY_TYPE_CONSTANT", SWIG_From_int((int)(REPOKEY_TYPE_CONSTANT)));
  rb_define_const(mSolv, "REPOKEY_TYPE_CONSTANTID", SWIG_From_int((int)(REPOKEY_TYPE_CONSTANTID)));
  rb_define_const(mSolv, "REPOKEY_TYPE_ID", SWIG_From_int((int)(REPOKEY_TYPE_ID)));
  rb_define_const(mSolv, "REPOKEY_TYPE_NUM", SWIG_From_int((int)(REPOKEY_TYPE_NUM)));
  rb_define_const(mSolv, "REPOKEY_TYPE_DIR", SWIG_From_int((int)(REPOKEY_TYPE_DIR)));
  rb_define_const(mSolv, "REPOKEY_TYPE_STR", SWIG_From_int((int)(REPOKEY_TYPE_STR)));
  rb_define_const(mSolv, "REPOKEY_TYPE_BINARY", SWIG_From_int((int)(REPOKEY_TYPE_BINARY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_IDARRAY", SWIG_From_int((int)(REPOKEY_TYPE_IDARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_REL_IDARRAY", SWIG_From_int((int)(REPOKEY_TYPE_REL_IDARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_DIRSTRARRAY", SWIG_From_int((int)(REPOKEY_TYPE_DIRSTRARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_DIRNUMNUMARRAY", SWIG_From_int((int)(REPOKEY_TYPE_DIRNUMNUMARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_MD5", SWIG_From_int((int)(REPOKEY_TYPE_MD5)));
  rb_define_const(mSolv, "REPOKEY_TYPE_SHA1", SWIG_From_int((int)(REPOKEY_TYPE_SHA1)));
  rb_define_const(mSolv, "REPOKEY_TYPE_SHA224", SWIG_From_int((int)(REPOKEY_TYPE_SHA224)));
  rb_define_const(mSolv, "REPOKEY_TYPE_SHA256", SWIG_From_int((int)(REPOKEY_TYPE_SHA256)));
  rb_define_const(mSolv, "REPOKEY_TYPE_SHA384", SWIG_From_int((int)(REPOKEY_TYPE_SHA384)));
  rb_define_const(mSolv, "REPOKEY_TYPE_SHA512", SWIG_From_int((int)(REPOKEY_TYPE_SHA512)));
  rb_define_const(mSolv, "REPOKEY_TYPE_FIXARRAY", SWIG_From_int((int)(REPOKEY_TYPE_FIXARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_FLEXARRAY", SWIG_From_int((int)(REPOKEY_TYPE_FLEXARRAY)));
  rb_define_const(mSolv, "REPOKEY_TYPE_DELETED", SWIG_From_int((int)(REPOKEY_TYPE_DELETED)));
  rb_define_const(mSolv, "SOLVABLE_SUMMARY", SWIG_From_int((int)(SOLVABLE_SUMMARY)));
  rb_define_const(mSolv, "SOLVABLE_DESCRIPTION", SWIG_From_int((int)(SOLVABLE_DESCRIPTION)));
  rb_define_const(mSolv, "SOLVABLE_DISTRIBUTION", SWIG_From_int((int)(SOLVABLE_DISTRIBUTION)));
  rb_define_const(mSolv, "SOLVABLE_AUTHORS", SWIG_From_int((int)(SOLVABLE_AUTHORS)));
  rb_define_const(mSolv, "SOLVABLE_PACKAGER", SWIG_From_int((int)(SOLVABLE_PACKAGER)));
  rb_define_const(mSolv, "SOLVABLE_GROUP", SWIG_From_int((int)(SOLVABLE_GROUP)));
  rb_define_const(mSolv, "SOLVABLE_URL", SWIG_From_int((int)(SOLVABLE_URL)));
  rb_define_const(mSolv, "SOLVABLE_KEYWORDS", SWIG_From_int((int)(SOLVABLE_KEYWORDS)));
  rb_define_const(mSolv, "SOLVABLE_LICENSE", SWIG_From_int((int)(SOLVABLE_LICENSE)));
  rb_define_const(mSolv, "SOLVABLE_BUILDTIME", SWIG_From_int((int)(SOLVABLE_BUILDTIME)));
  rb_define_const(mSolv, "SOLVABLE_BUILDHOST", SWIG_From_int((int)(SOLVABLE_BUILDHOST)));
  rb_define_const(mSolv, "SOLVABLE_EULA", SWIG_From_int((int)(SOLVABLE_EULA)));
  rb_define_const(mSolv, "SOLVABLE_CPEID", SWIG_From_int((int)(SOLVABLE_CPEID)));
  rb_define_const(mSolv, "SOLVABLE_MESSAGEINS", SWIG_From_int((int)(SOLVABLE_MESSAGEINS)));
  rb_define_const(mSolv, "SOLVABLE_MESSAGEDEL", SWIG_From_int((int)(SOLVABLE_MESSAGEDEL)));
  rb_define_const(mSolv, "SOLVABLE_INSTALLSIZE", SWIG_From_int((int)(SOLVABLE_INSTALLSIZE)));
  rb_define_const(mSolv, "SOLVABLE_DISKUSAGE", SWIG_From_int((int)(SOLVABLE_DISKUSAGE)));
  rb_define_const(mSolv, "SOLVABLE_FILELIST", SWIG_From_int((int)(SOLVABLE_FILELIST)));
  rb_define_const(mSolv, "SOLVABLE_INSTALLTIME", SWIG_From_int((int)(SOLVABLE_INSTALLTIME)));
  rb_define_const(mSolv, "SOLVABLE_MEDIADIR", SWIG_From_int((int)(SOLVABLE_MEDIADIR)));
  rb_define_const(mSolv, "SOLVABLE_MEDIAFILE", SWIG_From_int((int)(SOLVABLE_MEDIAFILE)));
  rb_define_const(mSolv, "SOLVABLE_MEDIANR", SWIG_From_int((int)(SOLVABLE_MEDIANR)));
  rb_define_const(mSolv, "SOLVABLE_MEDIABASE", SWIG_From_int((int)(SOLVABLE_MEDIABASE)));
  rb_define_const(mSolv, "SOLVABLE_DOWNLOADSIZE", SWIG_From_int((int)(SOLVABLE_DOWNLOADSIZE)));
  rb_define_const(mSolv, "SOLVABLE_SOURCEARCH", SWIG_From_int((int)(SOLVABLE_SOURCEARCH)));
  rb_define_const(mSolv, "SOLVABLE_SOURCENAME", SWIG_From_int((int)(SOLVABLE_SOURCENAME)));
  rb_define_const(mSolv, "SOLVABLE_SOURCEEVR", SWIG_From_int((int)(SOLVABLE_SOURCEEVR)));
  rb_define_const(mSolv, "SOLVABLE_ISVISIBLE", SWIG_From_int((int)(SOLVABLE_ISVISIBLE)));
  rb_define_const(mSolv, "SOLVABLE_TRIGGERS", SWIG_From_int((int)(SOLVABLE_TRIGGERS)));
  rb_define_const(mSolv, "SOLVABLE_CHECKSUM", SWIG_From_int((int)(SOLVABLE_CHECKSUM)));
  rb_define_const(mSolv, "SOLVABLE_PKGID", SWIG_From_int((int)(SOLVABLE_PKGID)));
  rb_define_const(mSolv, "SOLVABLE_HDRID", SWIG_From_int((int)(SOLVABLE_HDRID)));
  rb_define_const(mSolv, "SOLVABLE_LEADSIGID", SWIG_From_int((int)(SOLVABLE_LEADSIGID)));
  rb_define_const(mSolv, "SOLVABLE_PATCHCATEGORY", SWIG_From_int((int)(SOLVABLE_PATCHCATEGORY)));
  rb_define_const(mSolv, "SOLVABLE_HEADEREND", SWIG_From_int((int)(SOLVABLE_HEADEREND)));
  rb_define_const(mSolv, "SOLVABLE_CHANGELOG", SWIG_From_int((int)(SOLVABLE_CHANGELOG)));
  rb_define_const(mSolv, "SOLVABLE_CHANGELOG_AUTHOR", SWIG_From_int((int)(SOLVABLE_CHANGELOG_AUTHOR)));
  rb_define_const(mSolv, "SOLVABLE_CHANGELOG_TIME", SWIG_From_int((int)(SOLVABLE_CHANGELOG_TIME)));
  rb_define_const(mSolv, "SOLVABLE_CHANGELOG_TEXT", SWIG_From_int((int)(SOLVABLE_CHANGELOG_TEXT)));
  rb_define_const(mSolv, "SOLVABLE_INSTALLSTATUS", SWIG_From_int((int)(SOLVABLE_INSTALLSTATUS)));
  rb_define_const(mSolv, "SOLVABLE_PREREQ_IGNOREINST", SWIG_From_int((int)(SOLVABLE_PREREQ_IGNOREINST)));
  rb_define_const(mSolv, "SOLVABLE_CATEGORY", SWIG_From_int((int)(SOLVABLE_CATEGORY)));
  rb_define_const(mSolv, "SOLVABLE_INCLUDES", SWIG_From_int((int)(SOLVABLE_INCLUDES)));
  rb_define_const(mSolv, "SOLVABLE_EXTENDS", SWIG_From_int((int)(SOLVABLE_EXTENDS)));
  rb_define_const(mSolv, "SOLVABLE_ICON", SWIG_From_int((int)(SOLVABLE_ICON)));
  rb_define_const(mSolv, "SOLVABLE_ORDER", SWIG_From_int((int)(SOLVABLE_ORDER)));
  rb_define_const(mSolv, "UPDATE_REBOOT", SWIG_From_int((int)(UPDATE_REBOOT)));
  rb_define_const(mSolv, "UPDATE_RESTART", SWIG_From_int((int)(UPDATE_RESTART)));
  rb_define_const(mSolv, "UPDATE_RELOGIN", SWIG_From_int((int)(UPDATE_RELOGIN)));
  rb_define_const(mSolv, "UPDATE_MESSAGE", SWIG_From_int((int)(UPDATE_MESSAGE)));
  rb_define_const(mSolv, "UPDATE_SEVERITY", SWIG_From_int((int)(UPDATE_SEVERITY)));
  rb_define_const(mSolv, "UPDATE_RIGHTS", SWIG_From_int((int)(UPDATE_RIGHTS)));
  rb_define_const(mSolv, "UPDATE_COLLECTION", SWIG_From_int((int)(UPDATE_COLLECTION)));
  rb_define_const(mSolv, "UPDATE_COLLECTION_NAME", SWIG_From_int((int)(UPDATE_COLLECTION_NAME)));
  rb_define_const(mSolv, "UPDATE_COLLECTION_EVR", SWIG_From_int((int)(UPDATE_COLLECTION_EVR)));
  rb_define_const(mSolv, "UPDATE_COLLECTION_ARCH", SWIG_From_int((int)(UPDATE_COLLECTION_ARCH)));
  rb_define_const(mSolv, "UPDATE_COLLECTION_FILENAME", SWIG_From_int((int)(UPDATE_COLLECTION_FILENAME)));
  rb_define_const(mSolv, "UPDATE_COLLECTION_FLAGS", SWIG_From_int((int)(UPDATE_COLLECTION_FLAGS)));
  rb_define_const(mSolv, "UPDATE_REFERENCE", SWIG_From_int((int)(UPDATE_REFERENCE)));
  rb_define_const(mSolv, "UPDATE_REFERENCE_TYPE", SWIG_From_int((int)(UPDATE_REFERENCE_TYPE)));
  rb_define_const(mSolv, "UPDATE_REFERENCE_HREF", SWIG_From_int((int)(UPDATE_REFERENCE_HREF)));
  rb_define_const(mSolv, "UPDATE_REFERENCE_ID", SWIG_From_int((int)(UPDATE_REFERENCE_ID)));
  rb_define_const(mSolv, "UPDATE_REFERENCE_TITLE", SWIG_From_int((int)(UPDATE_REFERENCE_TITLE)));
  rb_define_const(mSolv, "PRODUCT_REFERENCEFILE", SWIG_From_int((int)(PRODUCT_REFERENCEFILE)));
  rb_define_const(mSolv, "PRODUCT_SHORTLABEL", SWIG_From_int((int)(PRODUCT_SHORTLABEL)));
  rb_define_const(mSolv, "PRODUCT_DISTPRODUCT", SWIG_From_int((int)(PRODUCT_DISTPRODUCT)));
  rb_define_const(mSolv, "PRODUCT_DISTVERSION", SWIG_From_int((int)(PRODUCT_DISTVERSION)));
  rb_define_const(mSolv, "PRODUCT_TYPE", SWIG_From_int((int)(PRODUCT_TYPE)));
  rb_define_const(mSolv, "PRODUCT_URL", SWIG_From_int((int)(PRODUCT_URL)));
  rb_define_const(mSolv, "PRODUCT_URL_TYPE", SWIG_From_int((int)(PRODUCT_URL_TYPE)));
  rb_define_const(mSolv, "PRODUCT_FLAGS", SWIG_From_int((int)(PRODUCT_FLAGS)));
  rb_define_const(mSolv, "PRODUCT_PRODUCTLINE", SWIG_From_int((int)(PRODUCT_PRODUCTLINE)));
  rb_define_const(mSolv, "PRODUCT_REGISTER_TARGET", SWIG_From_int((int)(PRODUCT_REGISTER_TARGET)));
  rb_define_const(mSolv, "PRODUCT_REGISTER_FLAVOR", SWIG_From_int((int)(PRODUCT_REGISTER_FLAVOR)));
  rb_define_const(mSolv, "PRODUCT_REGISTER_RELEASE", SWIG_From_int((int)(PRODUCT_REGISTER_RELEASE)));
  rb_define_const(mSolv, "PRODUCT_UPDATES_REPOID", SWIG_From_int((int)(PRODUCT_UPDATES_REPOID)));
  rb_define_const(mSolv, "PRODUCT_UPDATES", SWIG_From_int((int)(PRODUCT_UPDATES)));
  rb_define_const(mSolv, "PRODUCT_ENDOFLIFE", SWIG_From_int((int)(PRODUCT_ENDOFLIFE)));
  rb_define_const(mSolv, "SUSETAGS_DATADIR", SWIG_From_int((int)(SUSETAGS_DATADIR)));
  rb_define_const(mSolv, "SUSETAGS_DESCRDIR", SWIG_From_int((int)(SUSETAGS_DESCRDIR)));
  rb_define_const(mSolv, "SUSETAGS_DEFAULTVENDOR", SWIG_From_int((int)(SUSETAGS_DEFAULTVENDOR)));
  rb_define_const(mSolv, "SUSETAGS_FILE", SWIG_From_int((int)(SUSETAGS_FILE)));
  rb_define_const(mSolv, "SUSETAGS_FILE_NAME", SWIG_From_int((int)(SUSETAGS_FILE_NAME)));
  rb_define_const(mSolv, "SUSETAGS_FILE_TYPE", SWIG_From_int((int)(SUSETAGS_FILE_TYPE)));
  rb_define_const(mSolv, "SUSETAGS_FILE_CHECKSUM", SWIG_From_int((int)(SUSETAGS_FILE_CHECKSUM)));
  rb_define_const(mSolv, "SUSETAGS_SHARE_NAME", SWIG_From_int((int)(SUSETAGS_SHARE_NAME)));
  rb_define_const(mSolv, "SUSETAGS_SHARE_EVR", SWIG_From_int((int)(SUSETAGS_SHARE_EVR)));
  rb_define_const(mSolv, "SUSETAGS_SHARE_ARCH", SWIG_From_int((int)(SUSETAGS_SHARE_ARCH)));
  rb_define_const(mSolv, "REPOSITORY_ADDEDFILEPROVIDES", SWIG_From_int((int)(REPOSITORY_ADDEDFILEPROVIDES)));
  rb_define_const(mSolv, "REPOSITORY_RPMDBCOOKIE", SWIG_From_int((int)(REPOSITORY_RPMDBCOOKIE)));
  rb_define_const(mSolv, "REPOSITORY_FILTEREDFILELIST", SWIG_From_int((int)(REPOSITORY_FILTEREDFILELIST)));
  rb_define_const(mSolv, "REPOSITORY_TIMESTAMP", SWIG_From_int((int)(REPOSITORY_TIMESTAMP)));
  rb_define_const(mSolv, "REPOSITORY_EXPIRE", SWIG_From_int((int)(REPOSITORY_EXPIRE)));
  rb_define_const(mSolv, "REPOSITORY_UPDATES", SWIG_From_int((int)(REPOSITORY_UPDATES)));
  rb_define_const(mSolv, "REPOSITORY_DISTROS", SWIG_From_int((int)(REPOSITORY_DISTROS)));
  rb_define_const(mSolv, "REPOSITORY_PRODUCT_LABEL", SWIG_From_int((int)(REPOSITORY_PRODUCT_LABEL)));
  rb_define_const(mSolv, "REPOSITORY_PRODUCT_CPEID", SWIG_From_int((int)(REPOSITORY_PRODUCT_CPEID)));
  rb_define_const(mSolv, "REPOSITORY_REPOID", SWIG_From_int((int)(REPOSITORY_REPOID)));
  rb_define_const(mSolv, "REPOSITORY_KEYWORDS", SWIG_From_int((int)(REPOSITORY_KEYWORDS)));
  rb_define_const(mSolv, "REPOSITORY_REVISION", SWIG_From_int((int)(REPOSITORY_REVISION)));
  rb_define_const(mSolv, "REPOSITORY_TOOLVERSION", SWIG_From_int((int)(REPOSITORY_TOOLVERSION)));
  rb_define_const(mSolv, "DELTA_PACKAGE_NAME", SWIG_From_int((int)(DELTA_PACKAGE_NAME)));
  rb_define_const(mSolv, "DELTA_PACKAGE_EVR", SWIG_From_int((int)(DELTA_PACKAGE_EVR)));
  rb_define_const(mSolv, "DELTA_PACKAGE_ARCH", SWIG_From_int((int)(DELTA_PACKAGE_ARCH)));
  rb_define_const(mSolv, "DELTA_LOCATION_DIR", SWIG_From_int((int)(DELTA_LOCATION_DIR)));
  rb_define_const(mSolv, "DELTA_LOCATION_NAME", SWIG_From_int((int)(DELTA_LOCATION_NAME)));
  rb_define_const(mSolv, "DELTA_LOCATION_EVR", SWIG_From_int((int)(DELTA_LOCATION_EVR)));
  rb_define_const(mSolv, "DELTA_LOCATION_SUFFIX", SWIG_From_int((int)(DELTA_LOCATION_SUFFIX)));
  rb_define_const(mSolv, "DELTA_DOWNLOADSIZE", SWIG_From_int((int)(DELTA_DOWNLOADSIZE)));
  rb_define_const(mSolv, "DELTA_CHECKSUM", SWIG_From_int((int)(DELTA_CHECKSUM)));
  rb_define_const(mSolv, "DELTA_BASE_EVR", SWIG_From_int((int)(DELTA_BASE_EVR)));
  rb_define_const(mSolv, "DELTA_SEQ_NAME", SWIG_From_int((int)(DELTA_SEQ_NAME)));
  rb_define_const(mSolv, "DELTA_SEQ_EVR", SWIG_From_int((int)(DELTA_SEQ_EVR)));
  rb_define_const(mSolv, "DELTA_SEQ_NUM", SWIG_From_int((int)(DELTA_SEQ_NUM)));
  rb_define_const(mSolv, "DELTA_LOCATION_BASE", SWIG_From_int((int)(DELTA_LOCATION_BASE)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD", SWIG_From_int((int)(REPOSITORY_REPOMD)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_TYPE", SWIG_From_int((int)(REPOSITORY_REPOMD_TYPE)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_LOCATION", SWIG_From_int((int)(REPOSITORY_REPOMD_LOCATION)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_TIMESTAMP", SWIG_From_int((int)(REPOSITORY_REPOMD_TIMESTAMP)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_CHECKSUM", SWIG_From_int((int)(REPOSITORY_REPOMD_CHECKSUM)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_OPENCHECKSUM", SWIG_From_int((int)(REPOSITORY_REPOMD_OPENCHECKSUM)));
  rb_define_const(mSolv, "REPOSITORY_REPOMD_SIZE", SWIG_From_int((int)(REPOSITORY_REPOMD_SIZE)));
  rb_define_const(mSolv, "PUBKEY_KEYID", SWIG_From_int((int)(PUBKEY_KEYID)));
  rb_define_const(mSolv, "PUBKEY_FINGERPRINT", SWIG_From_int((int)(PUBKEY_FINGERPRINT)));
  rb_define_const(mSolv, "PUBKEY_EXPIRES", SWIG_From_int((int)(PUBKEY_EXPIRES)));
  rb_define_const(mSolv, "PUBKEY_SIGNATURES", SWIG_From_int((int)(PUBKEY_SIGNATURES)));
  rb_define_const(mSolv, "PUBKEY_DATA", SWIG_From_int((int)(PUBKEY_DATA)));
  rb_define_const(mSolv, "PUBKEY_SUBKEYOF", SWIG_From_int((int)(PUBKEY_SUBKEYOF)));
  rb_define_const(mSolv, "SIGNATURE_ISSUER", SWIG_From_int((int)(SIGNATURE_ISSUER)));
  rb_define_const(mSolv, "SIGNATURE_TIME", SWIG_From_int((int)(SIGNATURE_TIME)));
  rb_define_const(mSolv, "SIGNATURE_EXPIRES", SWIG_From_int((int)(SIGNATURE_EXPIRES)));
  rb_define_const(mSolv, "SIGNATURE_DATA", SWIG_From_int((int)(SIGNATURE_DATA)));
  rb_define_const(mSolv, "UPDATE_MODULE", SWIG_From_int((int)(UPDATE_MODULE)));
  rb_define_const(mSolv, "UPDATE_MODULE_NAME", SWIG_From_int((int)(UPDATE_MODULE_NAME)));
  rb_define_const(mSolv, "UPDATE_MODULE_STREAM", SWIG_From_int((int)(UPDATE_MODULE_STREAM)));
  rb_define_const(mSolv, "UPDATE_MODULE_VERSION", SWIG_From_int((int)(UPDATE_MODULE_VERSION)));
  rb_define_const(mSolv, "UPDATE_MODULE_CONTEXT", SWIG_From_int((int)(UPDATE_MODULE_CONTEXT)));
  rb_define_const(mSolv, "UPDATE_MODULE_ARCH", SWIG_From_int((int)(UPDATE_MODULE_ARCH)));
  rb_define_const(mSolv, "SOLVABLE_BUILDVERSION", SWIG_From_int((int)(SOLVABLE_BUILDVERSION)));
  rb_define_const(mSolv, "SOLVABLE_BUILDFLAVOR", SWIG_From_int((int)(SOLVABLE_BUILDFLAVOR)));
  rb_define_const(mSolv, "UPDATE_STATUS", SWIG_From_int((int)(UPDATE_STATUS)));
  rb_define_const(mSolv, "LIBSOLV_SELF_DESTRUCT_PKG", SWIG_From_int((int)(LIBSOLV_SELF_DESTRUCT_PKG)));
  rb_define_const(mSolv, "SOLVABLE_CONSTRAINS", SWIG_From_int((int)(SOLVABLE_CONSTRAINS)));
  rb_define_const(mSolv, "SOLVABLE_TRACK_FEATURES", SWIG_From_int((int)(SOLVABLE_TRACK_FEATURES)));
  rb_define_const(mSolv, "SOLVABLE_ISDEFAULT", SWIG_From_int((int)(SOLVABLE_ISDEFAULT)));
  rb_define_const(mSolv, "SOLVABLE_LANGONLY", SWIG_From_int((int)(SOLVABLE_LANGONLY)));
  rb_define_const(mSolv, "UPDATE_COLLECTIONLIST", SWIG_From_int((int)(UPDATE_COLLECTIONLIST)));
  rb_define_const(mSolv, "SOLVABLE_MULTIARCH", SWIG_From_int((int)(SOLVABLE_MULTIARCH)));
  rb_define_const(mSolv, "SOLVABLE_SIGNATUREDATA", SWIG_From_int((int)(SOLVABLE_SIGNATUREDATA)));
  rb_define_const(mSolv, "SOLVABLE_ORDERWITHREQUIRES", SWIG_From_int((int)(SOLVABLE_ORDERWITHREQUIRES)));
  rb_define_const(mSolv, "ID_NUM_INTERNAL", SWIG_From_int((int)(ID_NUM_INTERNAL)));
  rb_define_const(mSolv, "SOLVID_META", SWIG_From_int((int)(SOLVID_META)));
  rb_define_const(mSolv, "SOLVID_POS", SWIG_From_int((int)(SOLVID_POS)));
  rb_define_const(mSolv, "REL_EQ", SWIG_From_int((int)(REL_EQ)));
  rb_define_const(mSolv, "REL_GT", SWIG_From_int((int)(REL_GT)));
  rb_define_const(mSolv, "REL_LT", SWIG_From_int((int)(REL_LT)));
  rb_define_const(mSolv, "REL_AND", SWIG_From_int((int)(REL_AND)));
  rb_define_const(mSolv, "REL_OR", SWIG_From_int((int)(REL_OR)));
  rb_define_const(mSolv, "REL_WITH", SWIG_From_int((int)(REL_WITH)));
  rb_define_const(mSolv, "REL_NAMESPACE", SWIG_From_int((int)(REL_NAMESPACE)));
  rb_define_const(mSolv, "REL_ARCH", SWIG_From_int((int)(REL_ARCH)));
  rb_define_const(mSolv, "REL_FILECONFLICT", SWIG_From_int((int)(REL_FILECONFLICT)));
  rb_define_const(mSolv, "REL_COND", SWIG_From_int((int)(REL_COND)));
  rb_define_const(mSolv, "REL_COMPAT", SWIG_From_int((int)(REL_COMPAT)));
  rb_define_const(mSolv, "REL_KIND", SWIG_From_int((int)(REL_KIND)));
  rb_define_const(mSolv, "REL_MULTIARCH", SWIG_From_int((int)(REL_MULTIARCH)));
  rb_define_const(mSolv, "REL_ELSE", SWIG_From_int((int)(REL_ELSE)));
  rb_define_const(mSolv, "REL_ERROR", SWIG_From_int((int)(REL_ERROR)));
  rb_define_const(mSolv, "REL_WITHOUT", SWIG_From_int((int)(REL_WITHOUT)));
  rb_define_const(mSolv, "REL_UNLESS", SWIG_From_int((int)(REL_UNLESS)));
  rb_define_const(mSolv, "REL_CONDA", SWIG_From_int((int)(REL_CONDA)));
  
  SwigClassSelection.klass = rb_define_class_under(mSolv, "Selection", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Selection, (void *) &SwigClassSelection);
  rb_define_alloc_func(SwigClassSelection.klass, _wrap_Selection_allocate);
  rb_define_method(SwigClassSelection.klass, "initialize", _wrap_new_Selection, -1);
  rb_define_method(SwigClassSelection.klass, "pool", _wrap_Selection_pool_get, -1);
  rb_define_method(SwigClassSelection.klass, "flags", _wrap_Selection_flags_get, -1);
  rb_define_const(SwigClassSelection.klass, "SELECTION_NAME", SWIG_From_int((int)(SELECTION_NAME)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_PROVIDES", SWIG_From_int((int)(SELECTION_PROVIDES)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_FILELIST", SWIG_From_int((int)(SELECTION_FILELIST)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_CANON", SWIG_From_int((int)(SELECTION_CANON)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_DOTARCH", SWIG_From_int((int)(SELECTION_DOTARCH)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_REL", SWIG_From_int((int)(SELECTION_REL)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_INSTALLED_ONLY", SWIG_From_int((int)(SELECTION_INSTALLED_ONLY)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_GLOB", SWIG_From_int((int)(SELECTION_GLOB)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_FLAT", SWIG_From_int((int)(SELECTION_FLAT)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_NOCASE", SWIG_From_int((int)(SELECTION_NOCASE)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_SKIP_KIND", SWIG_From_int((int)(SELECTION_SKIP_KIND)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_MATCH_DEPSTR", SWIG_From_int((int)(SELECTION_MATCH_DEPSTR)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_SOURCE_ONLY", SWIG_From_int((int)(SELECTION_SOURCE_ONLY)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_WITH_SOURCE", SWIG_From_int((int)(SELECTION_WITH_SOURCE)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_WITH_DISABLED", SWIG_From_int((int)(SELECTION_WITH_DISABLED)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_WITH_BADARCH", SWIG_From_int((int)(SELECTION_WITH_BADARCH)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_WITH_ALL", SWIG_From_int((int)(SELECTION_WITH_ALL)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_ADD", SWIG_From_int((int)(SELECTION_ADD)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_SUBTRACT", SWIG_From_int((int)(SELECTION_SUBTRACT)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_FILTER", SWIG_From_int((int)(SELECTION_FILTER)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_FILTER_KEEP_IFEMPTY", SWIG_From_int((int)(SELECTION_FILTER_KEEP_IFEMPTY)));
  rb_define_const(SwigClassSelection.klass, "SELECTION_FILTER_SWAPPED", SWIG_From_int((int)(SELECTION_FILTER_SWAPPED)));
  rb_define_method(SwigClassSelection.klass, "isempty?", _wrap_Selection_isemptyq___, -1);
  rb_define_method(SwigClassSelection.klass, "clone", _wrap_Selection_clone, -1);
  rb_define_method(SwigClassSelection.klass, "filter", _wrap_Selection_filter, -1);
  rb_define_method(SwigClassSelection.klass, "add", _wrap_Selection_add, -1);
  rb_define_method(SwigClassSelection.klass, "add_raw", _wrap_Selection_add_raw, -1);
  rb_define_method(SwigClassSelection.klass, "subtract", _wrap_Selection_subtract, -1);
  rb_define_method(SwigClassSelection.klass, "select", _wrap_Selection_select, -1);
  rb_define_method(SwigClassSelection.klass, "matchdeps", _wrap_Selection_matchdeps, -1);
  rb_define_method(SwigClassSelection.klass, "matchdepid", _wrap_Selection_matchdepid, -1);
  rb_define_method(SwigClassSelection.klass, "matchsolvable", _wrap_Selection_matchsolvable, -1);
  rb_define_method(SwigClassSelection.klass, "jobs", _wrap_Selection_jobs, -1);
  rb_define_method(SwigClassSelection.klass, "solvables", _wrap_Selection_solvables, -1);
  rb_define_method(SwigClassSelection.klass, "to_s", _wrap_Selection_to_s, -1);
  rb_define_method(SwigClassSelection.klass, "inspect", _wrap_Selection___repr__, -1);
  SwigClassSelection.mark = 0;
  SwigClassSelection.destroy = (void (*)(void *)) free_Selection;
  SwigClassSelection.trackObjects = 0;
  
  SwigClassDep.klass = rb_define_class_under(mSolv, "Dep", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Dep, (void *) &SwigClassDep);
  rb_define_alloc_func(SwigClassDep.klass, _wrap_Dep_allocate);
  rb_define_method(SwigClassDep.klass, "initialize", _wrap_new_Dep, -1);
  rb_define_method(SwigClassDep.klass, "pool", _wrap_Dep_pool_get, -1);
  rb_define_method(SwigClassDep.klass, "id", _wrap_Dep_id_get, -1);
  rb_define_method(SwigClassDep.klass, "Rel", _wrap_Dep_Rel, -1);
  rb_define_method(SwigClassDep.klass, "Selection_name", _wrap_Dep_Selection_name, -1);
  rb_define_method(SwigClassDep.klass, "Selection_provides", _wrap_Dep_Selection_provides, -1);
  rb_define_method(SwigClassDep.klass, "str", _wrap_Dep_str, -1);
  rb_define_method(SwigClassDep.klass, "==", _wrap_Dep___eq__, -1);
  rb_define_method(SwigClassDep.klass, "__ne__", _wrap_Dep___ne__, -1);
  rb_define_method(SwigClassDep.klass, "to_s", _wrap_Dep_to_s, -1);
  rb_define_method(SwigClassDep.klass, "inspect", _wrap_Dep___repr__, -1);
  SwigClassDep.mark = 0;
  SwigClassDep.destroy = (void (*)(void *)) free_Dep;
  SwigClassDep.trackObjects = 0;
  
  SwigClassDataiterator.klass = rb_define_class_under(mSolv, "Dataiterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Dataiterator, (void *) &SwigClassDataiterator);
  rb_include_module(SwigClassDataiterator.klass, rb_eval_string("Enumerable"));
  rb_define_alloc_func(SwigClassDataiterator.klass, _wrap_Dataiterator_allocate);
  rb_define_method(SwigClassDataiterator.klass, "initialize", _wrap_new_Dataiterator, -1);
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_STRING", SWIG_From_int((int)(SEARCH_STRING)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_STRINGSTART", SWIG_From_int((int)(SEARCH_STRINGSTART)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_STRINGEND", SWIG_From_int((int)(SEARCH_STRINGEND)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_SUBSTRING", SWIG_From_int((int)(SEARCH_SUBSTRING)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_GLOB", SWIG_From_int((int)(SEARCH_GLOB)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_REGEX", SWIG_From_int((int)(SEARCH_REGEX)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_NOCASE", SWIG_From_int((int)(SEARCH_NOCASE)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_FILES", SWIG_From_int((int)(SEARCH_FILES)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_COMPLETE_FILELIST", SWIG_From_int((int)(SEARCH_COMPLETE_FILELIST)));
  rb_define_const(SwigClassDataiterator.klass, "SEARCH_CHECKSUMS", SWIG_From_int((int)(SEARCH_CHECKSUMS)));
  rb_define_method(SwigClassDataiterator.klass, "__next__", _wrap_Dataiterator___next__, -1);
  rb_define_method(SwigClassDataiterator.klass, "each", _wrap_Dataiterator_each, -1);
  rb_define_method(SwigClassDataiterator.klass, "prepend_keyname", _wrap_Dataiterator_prepend_keyname, -1);
  rb_define_method(SwigClassDataiterator.klass, "skip_solvable", _wrap_Dataiterator_skip_solvable, -1);
  SwigClassDataiterator.mark = 0;
  SwigClassDataiterator.destroy = (void (*)(void *)) free_Dataiterator;
  SwigClassDataiterator.trackObjects = 0;
  
  SwigClassXSolvable.klass = rb_define_class_under(mSolv, "XSolvable", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_XSolvable, (void *) &SwigClassXSolvable);
  rb_define_alloc_func(SwigClassXSolvable.klass, _wrap_XSolvable_allocate);
  rb_define_method(SwigClassXSolvable.klass, "initialize", _wrap_new_XSolvable, -1);
  rb_define_method(SwigClassXSolvable.klass, "pool", _wrap_XSolvable_pool_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "id", _wrap_XSolvable_id_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "str", _wrap_XSolvable_str, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_str", _wrap_XSolvable_lookup_str, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_id", _wrap_XSolvable_lookup_id, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_num", _wrap_XSolvable_lookup_num, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_void", _wrap_XSolvable_lookup_void, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_checksum", _wrap_XSolvable_lookup_checksum, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_idarray", _wrap_XSolvable_lookup_idarray, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_deparray", _wrap_XSolvable_lookup_deparray, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_location", _wrap_XSolvable_lookup_location, -1);
  rb_define_method(SwigClassXSolvable.klass, "lookup_sourcepkg", _wrap_XSolvable_lookup_sourcepkg, -1);
  rb_define_method(SwigClassXSolvable.klass, "Dataiterator", _wrap_XSolvable_Dataiterator, -1);
  rb_define_method(SwigClassXSolvable.klass, "installable?", _wrap_XSolvable_installableq___, -1);
  rb_define_method(SwigClassXSolvable.klass, "isinstalled?", _wrap_XSolvable_isinstalledq___, -1);
  rb_define_method(SwigClassXSolvable.klass, "name=", _wrap_XSolvable_name_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "name", _wrap_XSolvable_name_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "nameid=", _wrap_XSolvable_nameid_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "nameid", _wrap_XSolvable_nameid_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "evr=", _wrap_XSolvable_evr_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "evr", _wrap_XSolvable_evr_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "evrid=", _wrap_XSolvable_evrid_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "evrid", _wrap_XSolvable_evrid_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "arch=", _wrap_XSolvable_arch_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "arch", _wrap_XSolvable_arch_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "archid=", _wrap_XSolvable_archid_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "archid", _wrap_XSolvable_archid_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "vendor=", _wrap_XSolvable_vendor_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "vendor", _wrap_XSolvable_vendor_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "vendorid=", _wrap_XSolvable_vendorid_set, -1);
  rb_define_method(SwigClassXSolvable.klass, "vendorid", _wrap_XSolvable_vendorid_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "repo", _wrap_XSolvable_repo_get, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_provides", _wrap_XSolvable_add_provides, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_obsoletes", _wrap_XSolvable_add_obsoletes, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_conflicts", _wrap_XSolvable_add_conflicts, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_requires", _wrap_XSolvable_add_requires, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_recommends", _wrap_XSolvable_add_recommends, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_suggests", _wrap_XSolvable_add_suggests, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_supplements", _wrap_XSolvable_add_supplements, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_enhances", _wrap_XSolvable_add_enhances, -1);
  rb_define_method(SwigClassXSolvable.klass, "unset", _wrap_XSolvable_unset, -1);
  rb_define_method(SwigClassXSolvable.klass, "add_deparray", _wrap_XSolvable_add_deparray, -1);
  rb_define_method(SwigClassXSolvable.klass, "Selection", _wrap_XSolvable_Selection, -1);
  rb_define_method(SwigClassXSolvable.klass, "identical?", _wrap_XSolvable_identicalq___, -1);
  rb_define_method(SwigClassXSolvable.klass, "evrcmp", _wrap_XSolvable_evrcmp, -1);
  rb_define_method(SwigClassXSolvable.klass, "matchesdep?", _wrap_XSolvable_matchesdepq___, -1);
  rb_define_method(SwigClassXSolvable.klass, "==", _wrap_XSolvable___eq__, -1);
  rb_define_method(SwigClassXSolvable.klass, "__ne__", _wrap_XSolvable___ne__, -1);
  rb_define_method(SwigClassXSolvable.klass, "to_s", _wrap_XSolvable_to_s, -1);
  rb_define_method(SwigClassXSolvable.klass, "inspect", _wrap_XSolvable___repr__, -1);
  SwigClassXSolvable.mark = 0;
  SwigClassXSolvable.destroy = (void (*)(void *)) free_XSolvable;
  SwigClassXSolvable.trackObjects = 0;
  
  SwigClassRuleinfo.klass = rb_define_class_under(mSolv, "Ruleinfo", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Ruleinfo, (void *) &SwigClassRuleinfo);
  rb_define_alloc_func(SwigClassRuleinfo.klass, _wrap_Ruleinfo_allocate);
  rb_define_method(SwigClassRuleinfo.klass, "initialize", _wrap_new_Ruleinfo, -1);
  rb_define_method(SwigClassRuleinfo.klass, "solv", _wrap_Ruleinfo_solv_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "type", _wrap_Ruleinfo_type_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "dep_id", _wrap_Ruleinfo_dep_id_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "solvable", _wrap_Ruleinfo_solvable_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "othersolvable", _wrap_Ruleinfo_othersolvable_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "dep", _wrap_Ruleinfo_dep_get, -1);
  rb_define_method(SwigClassRuleinfo.klass, "problemstr", _wrap_Ruleinfo_problemstr, -1);
  rb_define_method(SwigClassRuleinfo.klass, "to_s", _wrap_Ruleinfo_to_s, -1);
  SwigClassRuleinfo.mark = 0;
  SwigClassRuleinfo.destroy = (void (*)(void *)) free_Ruleinfo;
  SwigClassRuleinfo.trackObjects = 0;
  
  SwigClassXRule.klass = rb_define_class_under(mSolv, "XRule", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_XRule, (void *) &SwigClassXRule);
  rb_define_alloc_func(SwigClassXRule.klass, _wrap_XRule_allocate);
  rb_define_method(SwigClassXRule.klass, "initialize", _wrap_new_XRule, -1);
  rb_define_method(SwigClassXRule.klass, "solv", _wrap_XRule_solv_get, -1);
  rb_define_method(SwigClassXRule.klass, "id", _wrap_XRule_id_get, -1);
  rb_define_method(SwigClassXRule.klass, "type", _wrap_XRule_type_get, -1);
  rb_define_method(SwigClassXRule.klass, "info", _wrap_XRule_info, -1);
  rb_define_method(SwigClassXRule.klass, "allinfos", _wrap_XRule_allinfos, -1);
  rb_define_method(SwigClassXRule.klass, "get_learnt", _wrap_XRule_get_learnt, -1);
  rb_define_method(SwigClassXRule.klass, "get_decisionlist", _wrap_XRule_get_decisionlist, -1);
  rb_define_method(SwigClassXRule.klass, "get_decisionsetlist", _wrap_XRule_get_decisionsetlist, -1);
  rb_define_method(SwigClassXRule.klass, "==", _wrap_XRule___eq__, -1);
  rb_define_method(SwigClassXRule.klass, "__ne__", _wrap_XRule___ne__, -1);
  rb_define_method(SwigClassXRule.klass, "inspect", _wrap_XRule___repr__, -1);
  SwigClassXRule.mark = 0;
  SwigClassXRule.destroy = (void (*)(void *)) free_XRule;
  SwigClassXRule.trackObjects = 0;
  
  SwigClassXRepodata.klass = rb_define_class_under(mSolv, "XRepodata", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_XRepodata, (void *) &SwigClassXRepodata);
  rb_define_alloc_func(SwigClassXRepodata.klass, _wrap_XRepodata_allocate);
  rb_define_method(SwigClassXRepodata.klass, "initialize", _wrap_new_XRepodata, -1);
  rb_define_method(SwigClassXRepodata.klass, "repo", _wrap_XRepodata_repo_get, -1);
  rb_define_method(SwigClassXRepodata.klass, "id", _wrap_XRepodata_id_get, -1);
  rb_define_method(SwigClassXRepodata.klass, "new_handle", _wrap_XRepodata_new_handle, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_id", _wrap_XRepodata_set_id, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_num", _wrap_XRepodata_set_num, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_str", _wrap_XRepodata_set_str, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_void", _wrap_XRepodata_set_void, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_poolstr", _wrap_XRepodata_set_poolstr, -1);
  rb_define_method(SwigClassXRepodata.klass, "add_idarray", _wrap_XRepodata_add_idarray, -1);
  rb_define_method(SwigClassXRepodata.klass, "add_flexarray", _wrap_XRepodata_add_flexarray, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_checksum", _wrap_XRepodata_set_checksum, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_sourcepkg", _wrap_XRepodata_set_sourcepkg, -1);
  rb_define_method(SwigClassXRepodata.klass, "set_location", _wrap_XRepodata_set_location, -1);
  rb_define_method(SwigClassXRepodata.klass, "unset", _wrap_XRepodata_unset, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_str", _wrap_XRepodata_lookup_str, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_id", _wrap_XRepodata_lookup_id, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_num", _wrap_XRepodata_lookup_num, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_void", _wrap_XRepodata_lookup_void, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_idarray", _wrap_XRepodata_lookup_idarray, -1);
  rb_define_method(SwigClassXRepodata.klass, "lookup_checksum", _wrap_XRepodata_lookup_checksum, -1);
  rb_define_method(SwigClassXRepodata.klass, "internalize", _wrap_XRepodata_internalize, -1);
  rb_define_method(SwigClassXRepodata.klass, "create_stubs", _wrap_XRepodata_create_stubs, -1);
  rb_define_method(SwigClassXRepodata.klass, "write", _wrap_XRepodata_write, -1);
  rb_define_method(SwigClassXRepodata.klass, "str2dir", _wrap_XRepodata_str2dir, -1);
  rb_define_method(SwigClassXRepodata.klass, "dir2str", _wrap_XRepodata_dir2str, -1);
  rb_define_method(SwigClassXRepodata.klass, "add_dirstr", _wrap_XRepodata_add_dirstr, -1);
  rb_define_method(SwigClassXRepodata.klass, "add_solv", _wrap_XRepodata_add_solv, -1);
  rb_define_method(SwigClassXRepodata.klass, "extend_to_repo", _wrap_XRepodata_extend_to_repo, -1);
  rb_define_method(SwigClassXRepodata.klass, "==", _wrap_XRepodata___eq__, -1);
  rb_define_method(SwigClassXRepodata.klass, "__ne__", _wrap_XRepodata___ne__, -1);
  rb_define_method(SwigClassXRepodata.klass, "inspect", _wrap_XRepodata___repr__, -1);
  SwigClassXRepodata.mark = 0;
  SwigClassXRepodata.destroy = (void (*)(void *)) free_XRepodata;
  SwigClassXRepodata.trackObjects = 0;
  
  SwigClassPool_solvable_iterator.klass = rb_define_class_under(mSolv, "Pool_solvable_iterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Pool_solvable_iterator, (void *) &SwigClassPool_solvable_iterator);
  rb_include_module(SwigClassPool_solvable_iterator.klass, rb_eval_string("Enumerable"));
  rb_define_alloc_func(SwigClassPool_solvable_iterator.klass, _wrap_Pool_solvable_iterator_allocate);
  rb_define_method(SwigClassPool_solvable_iterator.klass, "initialize", _wrap_new_Pool_solvable_iterator, -1);
  rb_define_method(SwigClassPool_solvable_iterator.klass, "__next__", _wrap_Pool_solvable_iterator___next__, -1);
  rb_define_method(SwigClassPool_solvable_iterator.klass, "each", _wrap_Pool_solvable_iterator_each, -1);
  rb_define_method(SwigClassPool_solvable_iterator.klass, "[]", _wrap_Pool_solvable_iterator___getitem__, -1);
  rb_define_method(SwigClassPool_solvable_iterator.klass, "length", _wrap_Pool_solvable_iterator___len__, -1);
  SwigClassPool_solvable_iterator.mark = 0;
  SwigClassPool_solvable_iterator.destroy = (void (*)(void *)) free_Pool_solvable_iterator;
  SwigClassPool_solvable_iterator.trackObjects = 0;
  
  SwigClassPool_repo_iterator.klass = rb_define_class_under(mSolv, "Pool_repo_iterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Pool_repo_iterator, (void *) &SwigClassPool_repo_iterator);
  rb_include_module(SwigClassPool_repo_iterator.klass, rb_eval_string("Enumerable"));
  rb_define_alloc_func(SwigClassPool_repo_iterator.klass, _wrap_Pool_repo_iterator_allocate);
  rb_define_method(SwigClassPool_repo_iterator.klass, "initialize", _wrap_new_Pool_repo_iterator, -1);
  rb_define_method(SwigClassPool_repo_iterator.klass, "__next__", _wrap_Pool_repo_iterator___next__, -1);
  rb_define_method(SwigClassPool_repo_iterator.klass, "each", _wrap_Pool_repo_iterator_each, -1);
  rb_define_method(SwigClassPool_repo_iterator.klass, "[]", _wrap_Pool_repo_iterator___getitem__, -1);
  rb_define_method(SwigClassPool_repo_iterator.klass, "length", _wrap_Pool_repo_iterator___len__, -1);
  SwigClassPool_repo_iterator.mark = 0;
  SwigClassPool_repo_iterator.destroy = (void (*)(void *)) free_Pool_repo_iterator;
  SwigClassPool_repo_iterator.trackObjects = 0;
  
  SwigClassRepo_solvable_iterator.klass = rb_define_class_under(mSolv, "Repo_solvable_iterator", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Repo_solvable_iterator, (void *) &SwigClassRepo_solvable_iterator);
  rb_include_module(SwigClassRepo_solvable_iterator.klass, rb_eval_string("Enumerable"));
  rb_define_alloc_func(SwigClassRepo_solvable_iterator.klass, _wrap_Repo_solvable_iterator_allocate);
  rb_define_method(SwigClassRepo_solvable_iterator.klass, "initialize", _wrap_new_Repo_solvable_iterator, -1);
  rb_define_method(SwigClassRepo_solvable_iterator.klass, "__next__", _wrap_Repo_solvable_iterator___next__, -1);
  rb_define_method(SwigClassRepo_solvable_iterator.klass, "each", _wrap_Repo_solvable_iterator_each, -1);
  rb_define_method(SwigClassRepo_solvable_iterator.klass, "[]", _wrap_Repo_solvable_iterator___getitem__, -1);
  rb_define_method(SwigClassRepo_solvable_iterator.klass, "length", _wrap_Repo_solvable_iterator___len__, -1);
  SwigClassRepo_solvable_iterator.mark = 0;
  SwigClassRepo_solvable_iterator.destroy = (void (*)(void *)) free_Repo_solvable_iterator;
  SwigClassRepo_solvable_iterator.trackObjects = 0;
  
  SwigClassDatamatch.klass = rb_define_class_under(mSolv, "Datamatch", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Datamatch, (void *) &SwigClassDatamatch);
  rb_undef_alloc_func(SwigClassDatamatch.klass);
  rb_define_method(SwigClassDatamatch.klass, "pool", _wrap_Datamatch_pool_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "repo", _wrap_Datamatch_repo_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "solvid", _wrap_Datamatch_solvid_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "solvable", _wrap_Datamatch_solvable_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "key_id", _wrap_Datamatch_key_id_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "key_idstr", _wrap_Datamatch_key_idstr_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "type_id", _wrap_Datamatch_type_id_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "type_idstr", _wrap_Datamatch_type_idstr_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "id", _wrap_Datamatch_id_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "idstr", _wrap_Datamatch_idstr_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "str", _wrap_Datamatch_str_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "dep", _wrap_Datamatch_dep_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "binary", _wrap_Datamatch_binary_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "num", _wrap_Datamatch_num_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "num2", _wrap_Datamatch_num2_get, -1);
  rb_define_method(SwigClassDatamatch.klass, "pos", _wrap_Datamatch_pos, -1);
  rb_define_method(SwigClassDatamatch.klass, "parentpos", _wrap_Datamatch_parentpos, -1);
  rb_define_method(SwigClassDatamatch.klass, "to_s", _wrap_Datamatch_to_s, -1);
  SwigClassDatamatch.mark = 0;
  SwigClassDatamatch.destroy = (void (*)(void *)) free_Datamatch;
  SwigClassDatamatch.trackObjects = 0;
  
  SwigClassDatapos.klass = rb_define_class_under(mSolv, "Datapos", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Datapos, (void *) &SwigClassDatapos);
  rb_undef_alloc_func(SwigClassDatapos.klass);
  rb_define_method(SwigClassDatapos.klass, "repo", _wrap_Datapos_repo_get, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_id", _wrap_Datapos_lookup_id, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_str", _wrap_Datapos_lookup_str, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_num", _wrap_Datapos_lookup_num, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_void", _wrap_Datapos_lookup_void, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_checksum", _wrap_Datapos_lookup_checksum, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_deltaseq", _wrap_Datapos_lookup_deltaseq, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_deltalocation", _wrap_Datapos_lookup_deltalocation, -1);
  rb_define_method(SwigClassDatapos.klass, "lookup_idarray", _wrap_Datapos_lookup_idarray, -1);
  rb_define_method(SwigClassDatapos.klass, "Dataiterator", _wrap_Datapos_Dataiterator, -1);
  SwigClassDatapos.mark = 0;
  SwigClassDatapos.destroy = (void (*)(void *)) free_Datapos;
  SwigClassDatapos.trackObjects = 0;
  
  SwigClassJob.klass = rb_define_class_under(mSolv, "Job", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Job, (void *) &SwigClassJob);
  rb_define_alloc_func(SwigClassJob.klass, _wrap_Job_allocate);
  rb_define_method(SwigClassJob.klass, "initialize", _wrap_new_Job, -1);
  rb_define_method(SwigClassJob.klass, "pool", _wrap_Job_pool_get, -1);
  rb_define_method(SwigClassJob.klass, "how=", _wrap_Job_how_set, -1);
  rb_define_method(SwigClassJob.klass, "how", _wrap_Job_how_get, -1);
  rb_define_method(SwigClassJob.klass, "what=", _wrap_Job_what_set, -1);
  rb_define_method(SwigClassJob.klass, "what", _wrap_Job_what_get, -1);
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE", SWIG_From_int((int)(SOLVER_SOLVABLE)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE_NAME", SWIG_From_int((int)(SOLVER_SOLVABLE_NAME)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE_PROVIDES", SWIG_From_int((int)(SOLVER_SOLVABLE_PROVIDES)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE_ONE_OF", SWIG_From_int((int)(SOLVER_SOLVABLE_ONE_OF)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE_REPO", SWIG_From_int((int)(SOLVER_SOLVABLE_REPO)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SOLVABLE_ALL", SWIG_From_int((int)(SOLVER_SOLVABLE_ALL)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SELECTMASK", SWIG_From_int((int)(SOLVER_SELECTMASK)));
  rb_define_const(SwigClassJob.klass, "SOLVER_NOOP", SWIG_From_int((int)(SOLVER_NOOP)));
  rb_define_const(SwigClassJob.klass, "SOLVER_INSTALL", SWIG_From_int((int)(SOLVER_INSTALL)));
  rb_define_const(SwigClassJob.klass, "SOLVER_ERASE", SWIG_From_int((int)(SOLVER_ERASE)));
  rb_define_const(SwigClassJob.klass, "SOLVER_UPDATE", SWIG_From_int((int)(SOLVER_UPDATE)));
  rb_define_const(SwigClassJob.klass, "SOLVER_WEAKENDEPS", SWIG_From_int((int)(SOLVER_WEAKENDEPS)));
  rb_define_const(SwigClassJob.klass, "SOLVER_MULTIVERSION", SWIG_From_int((int)(SOLVER_MULTIVERSION)));
  rb_define_const(SwigClassJob.klass, "SOLVER_LOCK", SWIG_From_int((int)(SOLVER_LOCK)));
  rb_define_const(SwigClassJob.klass, "SOLVER_DISTUPGRADE", SWIG_From_int((int)(SOLVER_DISTUPGRADE)));
  rb_define_const(SwigClassJob.klass, "SOLVER_VERIFY", SWIG_From_int((int)(SOLVER_VERIFY)));
  rb_define_const(SwigClassJob.klass, "SOLVER_DROP_ORPHANED", SWIG_From_int((int)(SOLVER_DROP_ORPHANED)));
  rb_define_const(SwigClassJob.klass, "SOLVER_USERINSTALLED", SWIG_From_int((int)(SOLVER_USERINSTALLED)));
  rb_define_const(SwigClassJob.klass, "SOLVER_ALLOWUNINSTALL", SWIG_From_int((int)(SOLVER_ALLOWUNINSTALL)));
  rb_define_const(SwigClassJob.klass, "SOLVER_FAVOR", SWIG_From_int((int)(SOLVER_FAVOR)));
  rb_define_const(SwigClassJob.klass, "SOLVER_DISFAVOR", SWIG_From_int((int)(SOLVER_DISFAVOR)));
  rb_define_const(SwigClassJob.klass, "SOLVER_EXCLUDEFROMWEAK", SWIG_From_int((int)(SOLVER_EXCLUDEFROMWEAK)));
  rb_define_const(SwigClassJob.klass, "SOLVER_JOBMASK", SWIG_From_int((int)(SOLVER_JOBMASK)));
  rb_define_const(SwigClassJob.klass, "SOLVER_WEAK", SWIG_From_int((int)(SOLVER_WEAK)));
  rb_define_const(SwigClassJob.klass, "SOLVER_ESSENTIAL", SWIG_From_int((int)(SOLVER_ESSENTIAL)));
  rb_define_const(SwigClassJob.klass, "SOLVER_CLEANDEPS", SWIG_From_int((int)(SOLVER_CLEANDEPS)));
  rb_define_const(SwigClassJob.klass, "SOLVER_FORCEBEST", SWIG_From_int((int)(SOLVER_FORCEBEST)));
  rb_define_const(SwigClassJob.klass, "SOLVER_TARGETED", SWIG_From_int((int)(SOLVER_TARGETED)));
  rb_define_const(SwigClassJob.klass, "SOLVER_NOTBYUSER", SWIG_From_int((int)(SOLVER_NOTBYUSER)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETEV", SWIG_From_int((int)(SOLVER_SETEV)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETEVR", SWIG_From_int((int)(SOLVER_SETEVR)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETARCH", SWIG_From_int((int)(SOLVER_SETARCH)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETVENDOR", SWIG_From_int((int)(SOLVER_SETVENDOR)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETREPO", SWIG_From_int((int)(SOLVER_SETREPO)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETNAME", SWIG_From_int((int)(SOLVER_SETNAME)));
  rb_define_const(SwigClassJob.klass, "SOLVER_NOAUTOSET", SWIG_From_int((int)(SOLVER_NOAUTOSET)));
  rb_define_const(SwigClassJob.klass, "SOLVER_SETMASK", SWIG_From_int((int)(SOLVER_SETMASK)));
  rb_define_method(SwigClassJob.klass, "solvables", _wrap_Job_solvables, -1);
  rb_define_method(SwigClassJob.klass, "isemptyupdate?", _wrap_Job_isemptyupdateq___, -1);
  rb_define_method(SwigClassJob.klass, "==", _wrap_Job___eq__, -1);
  rb_define_method(SwigClassJob.klass, "__ne__", _wrap_Job___ne__, -1);
  rb_define_method(SwigClassJob.klass, "to_s", _wrap_Job_to_s, -1);
  rb_define_method(SwigClassJob.klass, "inspect", _wrap_Job___repr__, -1);
  SwigClassJob.mark = 0;
  SwigClassJob.destroy = (void (*)(void *)) free_Job;
  SwigClassJob.trackObjects = 0;
  
  SwigClassPool.klass = rb_define_class_under(mSolv, "Pool", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Pool, (void *) &SwigClassPool);
  rb_define_alloc_func(SwigClassPool.klass, _wrap_Pool_allocate);
  rb_define_method(SwigClassPool.klass, "initialize", _wrap_new_Pool, -1);
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_PROMOTEEPOCH", SWIG_From_int((int)(POOL_FLAG_PROMOTEEPOCH)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_FORBIDSELFCONFLICTS", SWIG_From_int((int)(POOL_FLAG_FORBIDSELFCONFLICTS)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_OBSOLETEUSESPROVIDES", SWIG_From_int((int)(POOL_FLAG_OBSOLETEUSESPROVIDES)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES", SWIG_From_int((int)(POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_OBSOLETEUSESCOLORS", SWIG_From_int((int)(POOL_FLAG_OBSOLETEUSESCOLORS)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS", SWIG_From_int((int)(POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_NOINSTALLEDOBSOLETES", SWIG_From_int((int)(POOL_FLAG_NOINSTALLEDOBSOLETES)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_HAVEDISTEPOCH", SWIG_From_int((int)(POOL_FLAG_HAVEDISTEPOCH)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_NOOBSOLETESMULTIVERSION", SWIG_From_int((int)(POOL_FLAG_NOOBSOLETESMULTIVERSION)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_ADDFILEPROVIDESFILTERED", SWIG_From_int((int)(POOL_FLAG_ADDFILEPROVIDESFILTERED)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_NOWHATPROVIDESAUX", SWIG_From_int((int)(POOL_FLAG_NOWHATPROVIDESAUX)));
  rb_define_const(SwigClassPool.klass, "POOL_FLAG_WHATPROVIDESWITHDISABLED", SWIG_From_int((int)(POOL_FLAG_WHATPROVIDESWITHDISABLED)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_RPM", SWIG_From_int((int)(DISTTYPE_RPM)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_DEB", SWIG_From_int((int)(DISTTYPE_DEB)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_ARCH", SWIG_From_int((int)(DISTTYPE_ARCH)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_HAIKU", SWIG_From_int((int)(DISTTYPE_HAIKU)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_CONDA", SWIG_From_int((int)(DISTTYPE_CONDA)));
  rb_define_const(SwigClassPool.klass, "DISTTYPE_APK", SWIG_From_int((int)(DISTTYPE_APK)));
  rb_define_method(SwigClassPool.klass, "setdisttype", _wrap_Pool_setdisttype, -1);
  rb_define_method(SwigClassPool.klass, "set_debuglevel", _wrap_Pool_set_debuglevel, -1);
  rb_define_method(SwigClassPool.klass, "set_flag", _wrap_Pool_set_flag, -1);
  rb_define_method(SwigClassPool.klass, "get_flag", _wrap_Pool_get_flag, -1);
  rb_define_method(SwigClassPool.klass, "set_rootdir", _wrap_Pool_set_rootdir, -1);
  rb_define_method(SwigClassPool.klass, "get_rootdir", _wrap_Pool_get_rootdir, -1);
  rb_define_method(SwigClassPool.klass, "clr_loadcallback", _wrap_Pool_clr_loadcallback, -1);
  rb_define_method(SwigClassPool.klass, "set_loadcallback", _wrap_Pool_set_loadcallback, -1);
  rb_define_method(SwigClassPool.klass, "free", _wrap_Pool_free, -1);
  rb_define_method(SwigClassPool.klass, "disown", _wrap_Pool_disown, -1);
  rb_define_method(SwigClassPool.klass, "appdata=", _wrap_Pool_appdata_set, -1);
  rb_define_method(SwigClassPool.klass, "appdata", _wrap_Pool_appdata_get, -1);
  rb_define_method(SwigClassPool.klass, "appdata_disown", _wrap_Pool_appdata_disown, -1);
  rb_define_method(SwigClassPool.klass, "str2id", _wrap_Pool_str2id, -1);
  rb_define_method(SwigClassPool.klass, "Dep", _wrap_Pool_Dep, -1);
  rb_define_method(SwigClassPool.klass, "parserpmrichdep", _wrap_Pool_parserpmrichdep, -1);
  rb_define_method(SwigClassPool.klass, "id2str", _wrap_Pool_id2str, -1);
  rb_define_method(SwigClassPool.klass, "dep2str", _wrap_Pool_dep2str, -1);
  rb_define_method(SwigClassPool.klass, "rel2id", _wrap_Pool_rel2id, -1);
  rb_define_method(SwigClassPool.klass, "id2langid", _wrap_Pool_id2langid, -1);
  rb_define_method(SwigClassPool.klass, "setarch", _wrap_Pool_setarch, -1);
  rb_define_method(SwigClassPool.klass, "add_repo", _wrap_Pool_add_repo, -1);
  rb_define_method(SwigClassPool.klass, "lookup_str", _wrap_Pool_lookup_str, -1);
  rb_define_method(SwigClassPool.klass, "lookup_id", _wrap_Pool_lookup_id, -1);
  rb_define_method(SwigClassPool.klass, "lookup_num", _wrap_Pool_lookup_num, -1);
  rb_define_method(SwigClassPool.klass, "lookup_void", _wrap_Pool_lookup_void, -1);
  rb_define_method(SwigClassPool.klass, "lookup_checksum", _wrap_Pool_lookup_checksum, -1);
  rb_define_method(SwigClassPool.klass, "Dataiterator", _wrap_Pool_Dataiterator, -1);
  rb_define_method(SwigClassPool.klass, "Dataiterator_solvid", _wrap_Pool_Dataiterator_solvid, -1);
  rb_define_method(SwigClassPool.klass, "solvid2str", _wrap_Pool_solvid2str, -1);
  rb_define_method(SwigClassPool.klass, "solvidset2str", _wrap_Pool_solvidset2str, -1);
  rb_define_method(SwigClassPool.klass, "solvableset2str", _wrap_Pool_solvableset2str, -1);
  rb_define_method(SwigClassPool.klass, "addfileprovides", _wrap_Pool_addfileprovides, -1);
  rb_define_method(SwigClassPool.klass, "addfileprovides_queue", _wrap_Pool_addfileprovides_queue, -1);
  rb_define_method(SwigClassPool.klass, "createwhatprovides", _wrap_Pool_createwhatprovides, -1);
  rb_define_method(SwigClassPool.klass, "id2solvable", _wrap_Pool_id2solvable, -1);
  rb_define_method(SwigClassPool.klass, "solvables", _wrap_Pool_solvables_get, -1);
  rb_define_method(SwigClassPool.klass, "solvables_iter", _wrap_Pool_solvables_iter, -1);
  rb_define_method(SwigClassPool.klass, "id2repo", _wrap_Pool_id2repo, -1);
  rb_define_method(SwigClassPool.klass, "repos", _wrap_Pool_repos_get, -1);
  rb_define_method(SwigClassPool.klass, "repos_iter", _wrap_Pool_repos_iter, -1);
  rb_define_method(SwigClassPool.klass, "installed=", _wrap_Pool_installed_set, -1);
  rb_define_method(SwigClassPool.klass, "installed", _wrap_Pool_installed_get, -1);
  rb_define_method(SwigClassPool.klass, "errstr", _wrap_Pool_errstr_get, -1);
  rb_define_method(SwigClassPool.klass, "matchprovidingids", _wrap_Pool_matchprovidingids, -1);
  rb_define_method(SwigClassPool.klass, "Job", _wrap_Pool_Job, -1);
  rb_define_method(SwigClassPool.klass, "whatprovides", _wrap_Pool_whatprovides, -1);
  rb_define_method(SwigClassPool.klass, "best_solvables", _wrap_Pool_best_solvables, -1);
  rb_define_method(SwigClassPool.klass, "towhatprovides", _wrap_Pool_towhatprovides, -1);
  rb_define_method(SwigClassPool.klass, "set_namespaceproviders", _wrap_Pool_set_namespaceproviders, -1);
  rb_define_method(SwigClassPool.klass, "flush_namespaceproviders", _wrap_Pool_flush_namespaceproviders, -1);
  rb_define_method(SwigClassPool.klass, "whatcontainsdep", _wrap_Pool_whatcontainsdep, -1);
  rb_define_method(SwigClassPool.klass, "whatmatchesdep", _wrap_Pool_whatmatchesdep, -1);
  rb_define_method(SwigClassPool.klass, "whatmatchessolvable", _wrap_Pool_whatmatchessolvable, -1);
  rb_define_method(SwigClassPool.klass, "isknownarch?", _wrap_Pool_isknownarchq___, -1);
  rb_define_method(SwigClassPool.klass, "Solver", _wrap_Pool_Solver, -1);
  rb_define_method(SwigClassPool.klass, "Selection", _wrap_Pool_Selection, -1);
  rb_define_method(SwigClassPool.klass, "Selection_all", _wrap_Pool_Selection_all, -1);
  rb_define_method(SwigClassPool.klass, "select", _wrap_Pool_select, -1);
  rb_define_method(SwigClassPool.klass, "matchdeps", _wrap_Pool_matchdeps, -1);
  rb_define_method(SwigClassPool.klass, "matchdepid", _wrap_Pool_matchdepid, -1);
  rb_define_method(SwigClassPool.klass, "matchsolvable", _wrap_Pool_matchsolvable, -1);
  rb_define_method(SwigClassPool.klass, "get_considered_list", _wrap_Pool_get_considered_list, -1);
  rb_define_method(SwigClassPool.klass, "get_disabled_list", _wrap_Pool_get_disabled_list, -1);
  rb_define_method(SwigClassPool.klass, "set_considered_list", _wrap_Pool_set_considered_list, -1);
  rb_define_method(SwigClassPool.klass, "set_disabled_list", _wrap_Pool_set_disabled_list, -1);
  rb_define_method(SwigClassPool.klass, "setpooljobs", _wrap_Pool_setpooljobs, -1);
  rb_define_method(SwigClassPool.klass, "getpooljobs", _wrap_Pool_getpooljobs, -1);
  SwigClassPool.mark = (void (*)(void *)) mark_Pool;
  SwigClassPool.destroy = (void (*)(void *)) free_Pool;
  SwigClassPool.trackObjects = 0;
  
  SwigClassRepo.klass = rb_define_class_under(mSolv, "Repo", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Repo, (void *) &SwigClassRepo);
  rb_undef_alloc_func(SwigClassRepo.klass);
  rb_define_method(SwigClassRepo.klass, "pool", _wrap_Repo_pool_get, -1);
  rb_define_method(SwigClassRepo.klass, "name", _wrap_Repo_name_get, -1);
  rb_define_method(SwigClassRepo.klass, "priority=", _wrap_Repo_priority_set, -1);
  rb_define_method(SwigClassRepo.klass, "priority", _wrap_Repo_priority_get, -1);
  rb_define_method(SwigClassRepo.klass, "subpriority=", _wrap_Repo_subpriority_set, -1);
  rb_define_method(SwigClassRepo.klass, "subpriority", _wrap_Repo_subpriority_get, -1);
  rb_define_method(SwigClassRepo.klass, "nsolvables", _wrap_Repo_nsolvables_get, -1);
  rb_define_const(SwigClassRepo.klass, "REPO_REUSE_REPODATA", SWIG_From_int((int)(REPO_REUSE_REPODATA)));
  rb_define_const(SwigClassRepo.klass, "REPO_NO_INTERNALIZE", SWIG_From_int((int)(REPO_NO_INTERNALIZE)));
  rb_define_const(SwigClassRepo.klass, "REPO_LOCALPOOL", SWIG_From_int((int)(REPO_LOCALPOOL)));
  rb_define_const(SwigClassRepo.klass, "REPO_USE_LOADING", SWIG_From_int((int)(REPO_USE_LOADING)));
  rb_define_const(SwigClassRepo.klass, "REPO_EXTEND_SOLVABLES", SWIG_From_int((int)(REPO_EXTEND_SOLVABLES)));
  rb_define_const(SwigClassRepo.klass, "REPO_USE_ROOTDIR", SWIG_From_int((int)(REPO_USE_ROOTDIR)));
  rb_define_const(SwigClassRepo.klass, "REPO_NO_LOCATION", SWIG_From_int((int)(REPO_NO_LOCATION)));
  rb_define_const(SwigClassRepo.klass, "SOLV_ADD_NO_STUBS", SWIG_From_int((int)(SOLV_ADD_NO_STUBS)));
  rb_define_const(SwigClassRepo.klass, "SUSETAGS_RECORD_SHARES", SWIG_From_int((int)(SUSETAGS_RECORD_SHARES)));
  rb_define_method(SwigClassRepo.klass, "free", _wrap_Repo_free, -1);
  rb_define_method(SwigClassRepo.klass, "empty", _wrap_Repo_empty, -1);
  rb_define_method(SwigClassRepo.klass, "isempty?", _wrap_Repo_isemptyq___, -1);
  rb_define_method(SwigClassRepo.klass, "appdata=", _wrap_Repo_appdata_set, -1);
  rb_define_method(SwigClassRepo.klass, "appdata", _wrap_Repo_appdata_get, -1);
  rb_define_method(SwigClassRepo.klass, "add_solv", _wrap_Repo_add_solv, -1);
  rb_define_method(SwigClassRepo.klass, "add_solvable", _wrap_Repo_add_solvable, -1);
  rb_define_method(SwigClassRepo.klass, "add_rpmdb", _wrap_Repo_add_rpmdb, -1);
  rb_define_method(SwigClassRepo.klass, "add_rpmdb_reffp", _wrap_Repo_add_rpmdb_reffp, -1);
  rb_define_method(SwigClassRepo.klass, "add_rpm", _wrap_Repo_add_rpm, -1);
  rb_define_method(SwigClassRepo.klass, "add_rpmdb_pubkeys", _wrap_Repo_add_rpmdb_pubkeys, -1);
  rb_define_method(SwigClassRepo.klass, "add_pubkey", _wrap_Repo_add_pubkey, -1);
  rb_define_method(SwigClassRepo.klass, "add_keyring", _wrap_Repo_add_keyring, -1);
  rb_define_method(SwigClassRepo.klass, "add_keydir", _wrap_Repo_add_keydir, -1);
  rb_define_method(SwigClassRepo.klass, "add_rpmmd", _wrap_Repo_add_rpmmd, -1);
  rb_define_method(SwigClassRepo.klass, "add_repomdxml", _wrap_Repo_add_repomdxml, -1);
  rb_define_method(SwigClassRepo.klass, "add_updateinfoxml", _wrap_Repo_add_updateinfoxml, -1);
  rb_define_method(SwigClassRepo.klass, "add_deltainfoxml", _wrap_Repo_add_deltainfoxml, -1);
  rb_define_method(SwigClassRepo.klass, "add_debdb", _wrap_Repo_add_debdb, -1);
  rb_define_method(SwigClassRepo.klass, "add_debpackages", _wrap_Repo_add_debpackages, -1);
  rb_define_method(SwigClassRepo.klass, "add_deb", _wrap_Repo_add_deb, -1);
  rb_define_method(SwigClassRepo.klass, "add_susetags", _wrap_Repo_add_susetags, -1);
  rb_define_method(SwigClassRepo.klass, "add_content", _wrap_Repo_add_content, -1);
  rb_define_method(SwigClassRepo.klass, "add_products", _wrap_Repo_add_products, -1);
  rb_define_method(SwigClassRepo.klass, "add_mdk", _wrap_Repo_add_mdk, -1);
  rb_define_method(SwigClassRepo.klass, "add_mdk_info", _wrap_Repo_add_mdk_info, -1);
  rb_define_method(SwigClassRepo.klass, "add_arch_repo", _wrap_Repo_add_arch_repo, -1);
  rb_define_method(SwigClassRepo.klass, "add_arch_local", _wrap_Repo_add_arch_local, -1);
  rb_define_method(SwigClassRepo.klass, "add_arch_pkg", _wrap_Repo_add_arch_pkg, -1);
  rb_define_method(SwigClassRepo.klass, "internalize", _wrap_Repo_internalize, -1);
  rb_define_method(SwigClassRepo.klass, "write", _wrap_Repo_write, -1);
  rb_define_method(SwigClassRepo.klass, "write_first_repodata", _wrap_Repo_write_first_repodata, -1);
  rb_define_method(SwigClassRepo.klass, "Dataiterator", _wrap_Repo_Dataiterator, -1);
  rb_define_method(SwigClassRepo.klass, "Dataiterator_meta", _wrap_Repo_Dataiterator_meta, -1);
  rb_define_method(SwigClassRepo.klass, "id", _wrap_Repo_id_get, -1);
  rb_define_method(SwigClassRepo.klass, "solvables", _wrap_Repo_solvables_get, -1);
  rb_define_method(SwigClassRepo.klass, "meta", _wrap_Repo_meta_get, -1);
  rb_define_method(SwigClassRepo.klass, "solvables_iter", _wrap_Repo_solvables_iter, -1);
  rb_define_method(SwigClassRepo.klass, "add_repodata", _wrap_Repo_add_repodata, -1);
  rb_define_method(SwigClassRepo.klass, "create_stubs", _wrap_Repo_create_stubs, -1);
  rb_define_method(SwigClassRepo.klass, "iscontiguous?", _wrap_Repo_iscontiguousq___, -1);
  rb_define_method(SwigClassRepo.klass, "first_repodata", _wrap_Repo_first_repodata, -1);
  rb_define_method(SwigClassRepo.klass, "Selection", _wrap_Repo_Selection, -1);
  rb_define_method(SwigClassRepo.klass, "find_pubkey", _wrap_Repo_find_pubkey, -1);
  rb_define_method(SwigClassRepo.klass, "createshadow", _wrap_Repo_createshadow, -1);
  rb_define_method(SwigClassRepo.klass, "moveshadow", _wrap_Repo_moveshadow, -1);
  rb_define_method(SwigClassRepo.klass, "==", _wrap_Repo___eq__, -1);
  rb_define_method(SwigClassRepo.klass, "__ne__", _wrap_Repo___ne__, -1);
  rb_define_method(SwigClassRepo.klass, "to_s", _wrap_Repo_to_s, -1);
  rb_define_method(SwigClassRepo.klass, "inspect", _wrap_Repo___repr__, -1);
  SwigClassRepo.mark = 0;
  SwigClassRepo.trackObjects = 0;
  
  SwigClassDecision.klass = rb_define_class_under(mSolv, "Decision", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Decision, (void *) &SwigClassDecision);
  rb_define_alloc_func(SwigClassDecision.klass, _wrap_Decision_allocate);
  rb_define_method(SwigClassDecision.klass, "initialize", _wrap_new_Decision, -1);
  rb_define_method(SwigClassDecision.klass, "solv", _wrap_Decision_solv_get, -1);
  rb_define_method(SwigClassDecision.klass, "p", _wrap_Decision_p_get, -1);
  rb_define_method(SwigClassDecision.klass, "reason", _wrap_Decision_reason_get, -1);
  rb_define_method(SwigClassDecision.klass, "infoid", _wrap_Decision_infoid_get, -1);
  rb_define_method(SwigClassDecision.klass, "rule", _wrap_Decision_rule_get, -1);
  rb_define_method(SwigClassDecision.klass, "solvable", _wrap_Decision_solvable_get, -1);
  rb_define_method(SwigClassDecision.klass, "info", _wrap_Decision_info, -1);
  rb_define_method(SwigClassDecision.klass, "allinfos", _wrap_Decision_allinfos, -1);
  rb_define_method(SwigClassDecision.klass, "reasonstr", _wrap_Decision_reasonstr, -1);
  rb_define_method(SwigClassDecision.klass, "to_s", _wrap_Decision_to_s, -1);
  SwigClassDecision.mark = 0;
  SwigClassDecision.destroy = (void (*)(void *)) free_Decision;
  SwigClassDecision.trackObjects = 0;
  
  SwigClassDecisionset.klass = rb_define_class_under(mSolv, "Decisionset", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Decisionset, (void *) &SwigClassDecisionset);
  rb_define_alloc_func(SwigClassDecisionset.klass, _wrap_Decisionset_allocate);
  rb_define_method(SwigClassDecisionset.klass, "initialize", _wrap_new_Decisionset, -1);
  rb_define_method(SwigClassDecisionset.klass, "solv", _wrap_Decisionset_solv_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "p", _wrap_Decisionset_p_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "reason", _wrap_Decisionset_reason_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "infoid", _wrap_Decisionset_infoid_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "bits", _wrap_Decisionset_bits_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "type", _wrap_Decisionset_type_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "dep_id", _wrap_Decisionset_dep_id_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "info", _wrap_Decisionset_info, -1);
  rb_define_method(SwigClassDecisionset.klass, "dep", _wrap_Decisionset_dep_get, -1);
  rb_define_method(SwigClassDecisionset.klass, "solvables", _wrap_Decisionset_solvables, -1);
  rb_define_method(SwigClassDecisionset.klass, "decisions", _wrap_Decisionset_decisions, -1);
  rb_define_method(SwigClassDecisionset.klass, "reasonstr", _wrap_Decisionset_reasonstr, -1);
  rb_define_method(SwigClassDecisionset.klass, "to_s", _wrap_Decisionset_to_s, -1);
  SwigClassDecisionset.mark = 0;
  SwigClassDecisionset.destroy = (void (*)(void *)) free_Decisionset;
  SwigClassDecisionset.trackObjects = 0;
  
  rb_eval_string(
    "class Solv::Solver\n"
    "  def describe_weakdep_decision(s)\n"
    "    self.describe_weakdep_decision_raw(s).each_slice(3).map { |t, sid, id| [ t, Solv::XSolvable.new(self.pool, sid), Solv::Dep.new(self.pool, id)] }\n"
    "  end\n"
    "end\n"
    );
  
  
  SwigClassSolver.klass = rb_define_class_under(mSolv, "Solver", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Solver, (void *) &SwigClassSolver);
  rb_undef_alloc_func(SwigClassSolver.klass);
  rb_define_method(SwigClassSolver.klass, "pool", _wrap_Solver_pool_get, -1);
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_UNKNOWN", SWIG_From_int((int)(SOLVER_RULE_UNKNOWN)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG", SWIG_From_int((int)(SOLVER_RULE_PKG)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_NOT_INSTALLABLE", SWIG_From_int((int)(SOLVER_RULE_PKG_NOT_INSTALLABLE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP", SWIG_From_int((int)(SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_REQUIRES", SWIG_From_int((int)(SOLVER_RULE_PKG_REQUIRES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_SELF_CONFLICT", SWIG_From_int((int)(SOLVER_RULE_PKG_SELF_CONFLICT)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_CONFLICTS", SWIG_From_int((int)(SOLVER_RULE_PKG_CONFLICTS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_SAME_NAME", SWIG_From_int((int)(SOLVER_RULE_PKG_SAME_NAME)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_OBSOLETES", SWIG_From_int((int)(SOLVER_RULE_PKG_OBSOLETES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_IMPLICIT_OBSOLETES", SWIG_From_int((int)(SOLVER_RULE_PKG_IMPLICIT_OBSOLETES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_INSTALLED_OBSOLETES", SWIG_From_int((int)(SOLVER_RULE_PKG_INSTALLED_OBSOLETES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_RECOMMENDS", SWIG_From_int((int)(SOLVER_RULE_PKG_RECOMMENDS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_CONSTRAINS", SWIG_From_int((int)(SOLVER_RULE_PKG_CONSTRAINS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_PKG_SUPPLEMENTS", SWIG_From_int((int)(SOLVER_RULE_PKG_SUPPLEMENTS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_UPDATE", SWIG_From_int((int)(SOLVER_RULE_UPDATE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_FEATURE", SWIG_From_int((int)(SOLVER_RULE_FEATURE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_JOB", SWIG_From_int((int)(SOLVER_RULE_JOB)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP", SWIG_From_int((int)(SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM", SWIG_From_int((int)(SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_JOB_UNKNOWN_PACKAGE", SWIG_From_int((int)(SOLVER_RULE_JOB_UNKNOWN_PACKAGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_JOB_UNSUPPORTED", SWIG_From_int((int)(SOLVER_RULE_JOB_UNSUPPORTED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_DISTUPGRADE", SWIG_From_int((int)(SOLVER_RULE_DISTUPGRADE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_INFARCH", SWIG_From_int((int)(SOLVER_RULE_INFARCH)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_CHOICE", SWIG_From_int((int)(SOLVER_RULE_CHOICE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_LEARNT", SWIG_From_int((int)(SOLVER_RULE_LEARNT)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_BEST", SWIG_From_int((int)(SOLVER_RULE_BEST)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_YUMOBS", SWIG_From_int((int)(SOLVER_RULE_YUMOBS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_RECOMMENDS", SWIG_From_int((int)(SOLVER_RULE_RECOMMENDS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_BLACK", SWIG_From_int((int)(SOLVER_RULE_BLACK)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_STRICT_REPO_PRIORITY", SWIG_From_int((int)(SOLVER_RULE_STRICT_REPO_PRIORITY)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_JOB", SWIG_From_int((int)(SOLVER_SOLUTION_JOB)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_POOLJOB", SWIG_From_int((int)(SOLVER_SOLUTION_POOLJOB)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_INFARCH", SWIG_From_int((int)(SOLVER_SOLUTION_INFARCH)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_DISTUPGRADE", SWIG_From_int((int)(SOLVER_SOLUTION_DISTUPGRADE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_BEST", SWIG_From_int((int)(SOLVER_SOLUTION_BEST)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_ERASE", SWIG_From_int((int)(SOLVER_SOLUTION_ERASE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_REPLACE", SWIG_From_int((int)(SOLVER_SOLUTION_REPLACE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_REPLACE_DOWNGRADE", SWIG_From_int((int)(SOLVER_SOLUTION_REPLACE_DOWNGRADE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_REPLACE_ARCHCHANGE", SWIG_From_int((int)(SOLVER_SOLUTION_REPLACE_ARCHCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_REPLACE_VENDORCHANGE", SWIG_From_int((int)(SOLVER_SOLUTION_REPLACE_VENDORCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_SOLUTION_REPLACE_NAMECHANGE", SWIG_From_int((int)(SOLVER_SOLUTION_REPLACE_NAMECHANGE)));
  rb_define_const(SwigClassSolver.klass, "POLICY_ILLEGAL_DOWNGRADE", SWIG_From_int((int)(POLICY_ILLEGAL_DOWNGRADE)));
  rb_define_const(SwigClassSolver.klass, "POLICY_ILLEGAL_ARCHCHANGE", SWIG_From_int((int)(POLICY_ILLEGAL_ARCHCHANGE)));
  rb_define_const(SwigClassSolver.klass, "POLICY_ILLEGAL_VENDORCHANGE", SWIG_From_int((int)(POLICY_ILLEGAL_VENDORCHANGE)));
  rb_define_const(SwigClassSolver.klass, "POLICY_ILLEGAL_NAMECHANGE", SWIG_From_int((int)(POLICY_ILLEGAL_NAMECHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ALLOW_DOWNGRADE", SWIG_From_int((int)(SOLVER_FLAG_ALLOW_DOWNGRADE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ALLOW_ARCHCHANGE", SWIG_From_int((int)(SOLVER_FLAG_ALLOW_ARCHCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ALLOW_VENDORCHANGE", SWIG_From_int((int)(SOLVER_FLAG_ALLOW_VENDORCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ALLOW_NAMECHANGE", SWIG_From_int((int)(SOLVER_FLAG_ALLOW_NAMECHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ALLOW_UNINSTALL", SWIG_From_int((int)(SOLVER_FLAG_ALLOW_UNINSTALL)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_NO_UPDATEPROVIDE", SWIG_From_int((int)(SOLVER_FLAG_NO_UPDATEPROVIDE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_SPLITPROVIDES", SWIG_From_int((int)(SOLVER_FLAG_SPLITPROVIDES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_IGNORE_RECOMMENDED", SWIG_From_int((int)(SOLVER_FLAG_IGNORE_RECOMMENDED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ADD_ALREADY_RECOMMENDED", SWIG_From_int((int)(SOLVER_FLAG_ADD_ALREADY_RECOMMENDED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_NO_INFARCHCHECK", SWIG_From_int((int)(SOLVER_FLAG_NO_INFARCHCHECK)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_BEST_OBEY_POLICY", SWIG_From_int((int)(SOLVER_FLAG_BEST_OBEY_POLICY)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_NO_AUTOTARGET", SWIG_From_int((int)(SOLVER_FLAG_NO_AUTOTARGET)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_DUP_ALLOW_DOWNGRADE", SWIG_From_int((int)(SOLVER_FLAG_DUP_ALLOW_DOWNGRADE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE", SWIG_From_int((int)(SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE", SWIG_From_int((int)(SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_DUP_ALLOW_NAMECHANGE", SWIG_From_int((int)(SOLVER_FLAG_DUP_ALLOW_NAMECHANGE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_KEEP_ORPHANS", SWIG_From_int((int)(SOLVER_FLAG_KEEP_ORPHANS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_BREAK_ORPHANS", SWIG_From_int((int)(SOLVER_FLAG_BREAK_ORPHANS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_FOCUS_INSTALLED", SWIG_From_int((int)(SOLVER_FLAG_FOCUS_INSTALLED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_YUM_OBSOLETES", SWIG_From_int((int)(SOLVER_FLAG_YUM_OBSOLETES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_NEED_UPDATEPROVIDE", SWIG_From_int((int)(SOLVER_FLAG_NEED_UPDATEPROVIDE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_FOCUS_BEST", SWIG_From_int((int)(SOLVER_FLAG_FOCUS_BEST)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_STRONG_RECOMMENDS", SWIG_From_int((int)(SOLVER_FLAG_STRONG_RECOMMENDS)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_INSTALL_ALSO_UPDATES", SWIG_From_int((int)(SOLVER_FLAG_INSTALL_ALSO_UPDATES)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED", SWIG_From_int((int)(SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_STRICT_REPO_PRIORITY", SWIG_From_int((int)(SOLVER_FLAG_STRICT_REPO_PRIORITY)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_FLAG_FOCUS_NEW", SWIG_From_int((int)(SOLVER_FLAG_FOCUS_NEW)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_UNRELATED", SWIG_From_int((int)(SOLVER_REASON_UNRELATED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_UNIT_RULE", SWIG_From_int((int)(SOLVER_REASON_UNIT_RULE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_KEEP_INSTALLED", SWIG_From_int((int)(SOLVER_REASON_KEEP_INSTALLED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_RESOLVE_JOB", SWIG_From_int((int)(SOLVER_REASON_RESOLVE_JOB)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_UPDATE_INSTALLED", SWIG_From_int((int)(SOLVER_REASON_UPDATE_INSTALLED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_CLEANDEPS_ERASE", SWIG_From_int((int)(SOLVER_REASON_CLEANDEPS_ERASE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_RESOLVE", SWIG_From_int((int)(SOLVER_REASON_RESOLVE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_WEAKDEP", SWIG_From_int((int)(SOLVER_REASON_WEAKDEP)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_RESOLVE_ORPHAN", SWIG_From_int((int)(SOLVER_REASON_RESOLVE_ORPHAN)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_RECOMMENDED", SWIG_From_int((int)(SOLVER_REASON_RECOMMENDED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_SUPPLEMENTED", SWIG_From_int((int)(SOLVER_REASON_SUPPLEMENTED)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_UNSOLVABLE", SWIG_From_int((int)(SOLVER_REASON_UNSOLVABLE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_REASON_PREMISE", SWIG_From_int((int)(SOLVER_REASON_PREMISE)));
  rb_define_const(SwigClassSolver.klass, "SOLVER_RULE_RPM", SWIG_From_int((int)(SOLVER_RULE_RPM)));
  rb_define_method(SwigClassSolver.klass, "set_flag", _wrap_Solver_set_flag, -1);
  rb_define_method(SwigClassSolver.klass, "get_flag", _wrap_Solver_get_flag, -1);
  rb_define_method(SwigClassSolver.klass, "solve", _wrap_Solver_solve, -1);
  rb_define_method(SwigClassSolver.klass, "transaction", _wrap_Solver_transaction, -1);
  rb_define_method(SwigClassSolver.klass, "describe_decision", _wrap_Solver_describe_decision, -1);
  rb_define_method(SwigClassSolver.klass, "describe_weakdep_decision_raw", _wrap_Solver_describe_weakdep_decision_raw, -1);
  rb_define_method(SwigClassSolver.klass, "alternatives_count", _wrap_Solver_alternatives_count, -1);
  rb_define_method(SwigClassSolver.klass, "get_alternative", _wrap_Solver_get_alternative, -1);
  rb_define_method(SwigClassSolver.klass, "alternatives", _wrap_Solver_alternatives, -1);
  rb_define_method(SwigClassSolver.klass, "write_testcase", _wrap_Solver_write_testcase, -1);
  rb_define_method(SwigClassSolver.klass, "raw_decisions", _wrap_Solver_raw_decisions, -1);
  rb_define_method(SwigClassSolver.klass, "all_decisions", _wrap_Solver_all_decisions, -1);
  rb_define_method(SwigClassSolver.klass, "get_decision", _wrap_Solver_get_decision, -1);
  rb_define_method(SwigClassSolver.klass, "get_learnt", _wrap_Solver_get_learnt, -1);
  rb_define_method(SwigClassSolver.klass, "get_decisionlist", _wrap_Solver_get_decisionlist, -1);
  rb_define_method(SwigClassSolver.klass, "get_recommended", _wrap_Solver_get_recommended, -1);
  rb_define_method(SwigClassSolver.klass, "get_suggested", _wrap_Solver_get_suggested, -1);
  SwigClassSolver.mark = 0;
  SwigClassSolver.destroy = (void (*)(void *)) free_Solver;
  SwigClassSolver.trackObjects = 0;
  
  SwigClassChksum.klass = rb_define_class_under(mSolv, "Chksum", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Chksum, (void *) &SwigClassChksum);
  rb_define_alloc_func(SwigClassChksum.klass, _wrap_Chksum_allocate);
  rb_define_method(SwigClassChksum.klass, "initialize", _wrap_new_Chksum, -1);
  rb_define_singleton_method(SwigClassChksum.klass, "from_bin", _wrap_Chksum_from_bin, -1);
  rb_define_method(SwigClassChksum.klass, "type", _wrap_Chksum_type_get, -1);
  rb_define_method(SwigClassChksum.klass, "add", _wrap_Chksum_add, -1);
  rb_define_method(SwigClassChksum.klass, "add_fp", _wrap_Chksum_add_fp, -1);
  rb_define_method(SwigClassChksum.klass, "add_fd", _wrap_Chksum_add_fd, -1);
  rb_define_method(SwigClassChksum.klass, "add_stat", _wrap_Chksum_add_stat, -1);
  rb_define_method(SwigClassChksum.klass, "add_fstat", _wrap_Chksum_add_fstat, -1);
  rb_define_method(SwigClassChksum.klass, "raw", _wrap_Chksum_raw, -1);
  rb_define_method(SwigClassChksum.klass, "hex", _wrap_Chksum_hex, -1);
  rb_define_method(SwigClassChksum.klass, "typestr", _wrap_Chksum_typestr, -1);
  rb_define_method(SwigClassChksum.klass, "==", _wrap_Chksum___eq__, -1);
  rb_define_method(SwigClassChksum.klass, "__ne__", _wrap_Chksum___ne__, -1);
  rb_define_method(SwigClassChksum.klass, "to_s", _wrap_Chksum_to_s, -1);
  rb_define_method(SwigClassChksum.klass, "inspect", _wrap_Chksum___repr__, -1);
  SwigClassChksum.mark = 0;
  SwigClassChksum.destroy = (void (*)(void *)) free_Chksum;
  SwigClassChksum.trackObjects = 0;
  
  SwigClassSolvsig.klass = rb_define_class_under(mSolv, "Solvsig", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Solvsig, (void *) &SwigClassSolvsig);
  rb_define_alloc_func(SwigClassSolvsig.klass, _wrap_Solvsig_allocate);
  rb_define_method(SwigClassSolvsig.klass, "initialize", _wrap_new_Solvsig, -1);
  rb_define_method(SwigClassSolvsig.klass, "htype", _wrap_Solvsig_htype_get, -1);
  rb_define_method(SwigClassSolvsig.klass, "created", _wrap_Solvsig_created_get, -1);
  rb_define_method(SwigClassSolvsig.klass, "expires", _wrap_Solvsig_expires_get, -1);
  rb_define_method(SwigClassSolvsig.klass, "keyid", _wrap_Solvsig_keyid_get, -1);
  rb_define_method(SwigClassSolvsig.klass, "Chksum", _wrap_Solvsig_Chksum, -1);
  rb_define_method(SwigClassSolvsig.klass, "verify", _wrap_Solvsig_verify, -1);
  SwigClassSolvsig.mark = 0;
  SwigClassSolvsig.destroy = (void (*)(void *)) free_Solvsig;
  SwigClassSolvsig.trackObjects = 0;
  
  SwigClassSolvFp.klass = rb_define_class_under(mSolv, "SolvFp", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_SolvFp, (void *) &SwigClassSolvFp);
  rb_undef_alloc_func(SwigClassSolvFp.klass);
  rb_define_method(SwigClassSolvFp.klass, "fileno", _wrap_SolvFp_fileno, -1);
  rb_define_method(SwigClassSolvFp.klass, "dup", _wrap_SolvFp_dup, -1);
  rb_define_method(SwigClassSolvFp.klass, "write", _wrap_SolvFp_write, -1);
  rb_define_method(SwigClassSolvFp.klass, "flush", _wrap_SolvFp_flush, -1);
  rb_define_method(SwigClassSolvFp.klass, "close", _wrap_SolvFp_close, -1);
  rb_define_method(SwigClassSolvFp.klass, "cloexec", _wrap_SolvFp_cloexec, -1);
  SwigClassSolvFp.mark = 0;
  SwigClassSolvFp.destroy = (void (*)(void *)) free_SolvFp;
  SwigClassSolvFp.trackObjects = 0;
  rb_define_module_function(mSolv, "xfopen", _wrap_xfopen, -1);
  rb_define_module_function(mSolv, "xfopen_fd", _wrap_xfopen_fd, -1);
  
  SwigClassProblem.klass = rb_define_class_under(mSolv, "Problem", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Problem, (void *) &SwigClassProblem);
  rb_define_alloc_func(SwigClassProblem.klass, _wrap_Problem_allocate);
  rb_define_method(SwigClassProblem.klass, "initialize", _wrap_new_Problem, -1);
  rb_define_method(SwigClassProblem.klass, "solv", _wrap_Problem_solv_get, -1);
  rb_define_method(SwigClassProblem.klass, "id", _wrap_Problem_id_get, -1);
  rb_define_method(SwigClassProblem.klass, "findproblemrule", _wrap_Problem_findproblemrule, -1);
  rb_define_method(SwigClassProblem.klass, "findallproblemrules", _wrap_Problem_findallproblemrules, -1);
  rb_define_method(SwigClassProblem.klass, "solution_count", _wrap_Problem_solution_count, -1);
  rb_define_method(SwigClassProblem.klass, "solutions", _wrap_Problem_solutions, -1);
  rb_define_method(SwigClassProblem.klass, "get_learnt", _wrap_Problem_get_learnt, -1);
  rb_define_method(SwigClassProblem.klass, "get_decisionlist", _wrap_Problem_get_decisionlist, -1);
  rb_define_method(SwigClassProblem.klass, "get_decisionsetlist", _wrap_Problem_get_decisionsetlist, -1);
  rb_define_method(SwigClassProblem.klass, "to_s", _wrap_Problem_to_s, -1);
  SwigClassProblem.mark = 0;
  SwigClassProblem.destroy = (void (*)(void *)) free_Problem;
  SwigClassProblem.trackObjects = 0;
  
  SwigClassSolution.klass = rb_define_class_under(mSolv, "Solution", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Solution, (void *) &SwigClassSolution);
  rb_define_alloc_func(SwigClassSolution.klass, _wrap_Solution_allocate);
  rb_define_method(SwigClassSolution.klass, "initialize", _wrap_new_Solution, -1);
  rb_define_method(SwigClassSolution.klass, "solv", _wrap_Solution_solv_get, -1);
  rb_define_method(SwigClassSolution.klass, "problemid", _wrap_Solution_problemid_get, -1);
  rb_define_method(SwigClassSolution.klass, "id", _wrap_Solution_id_get, -1);
  rb_define_method(SwigClassSolution.klass, "element_count", _wrap_Solution_element_count, -1);
  rb_define_method(SwigClassSolution.klass, "elements", _wrap_Solution_elements, -1);
  SwigClassSolution.mark = 0;
  SwigClassSolution.destroy = (void (*)(void *)) free_Solution;
  SwigClassSolution.trackObjects = 0;
  
  SwigClassSolutionelement.klass = rb_define_class_under(mSolv, "Solutionelement", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Solutionelement, (void *) &SwigClassSolutionelement);
  rb_define_alloc_func(SwigClassSolutionelement.klass, _wrap_Solutionelement_allocate);
  rb_define_method(SwigClassSolutionelement.klass, "initialize", _wrap_new_Solutionelement, -1);
  rb_define_method(SwigClassSolutionelement.klass, "solv", _wrap_Solutionelement_solv_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "problemid", _wrap_Solutionelement_problemid_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "solutionid", _wrap_Solutionelement_solutionid_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "type", _wrap_Solutionelement_type_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "str", _wrap_Solutionelement_str, -1);
  rb_define_method(SwigClassSolutionelement.klass, "to_s", _wrap_Solutionelement_to_s, -1);
  rb_define_method(SwigClassSolutionelement.klass, "replaceelements", _wrap_Solutionelement_replaceelements, -1);
  rb_define_method(SwigClassSolutionelement.klass, "illegalreplace", _wrap_Solutionelement_illegalreplace, -1);
  rb_define_method(SwigClassSolutionelement.klass, "solvable", _wrap_Solutionelement_solvable_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "replacement", _wrap_Solutionelement_replacement_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "jobidx", _wrap_Solutionelement_jobidx_get, -1);
  rb_define_method(SwigClassSolutionelement.klass, "Job", _wrap_Solutionelement_Job, -1);
  SwigClassSolutionelement.mark = 0;
  SwigClassSolutionelement.destroy = (void (*)(void *)) free_Solutionelement;
  SwigClassSolutionelement.trackObjects = 0;
  
  SwigClassAlternative.klass = rb_define_class_under(mSolv, "Alternative", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Alternative, (void *) &SwigClassAlternative);
  rb_undef_alloc_func(SwigClassAlternative.klass);
  rb_define_method(SwigClassAlternative.klass, "solv", _wrap_Alternative_solv_get, -1);
  rb_define_method(SwigClassAlternative.klass, "type", _wrap_Alternative_type_get, -1);
  rb_define_method(SwigClassAlternative.klass, "dep_id", _wrap_Alternative_dep_id_get, -1);
  rb_define_method(SwigClassAlternative.klass, "chosen_id", _wrap_Alternative_chosen_id_get, -1);
  rb_define_method(SwigClassAlternative.klass, "level", _wrap_Alternative_level_get, -1);
  rb_define_const(SwigClassAlternative.klass, "SOLVER_ALTERNATIVE_TYPE_RULE", SWIG_From_int((int)(SOLVER_ALTERNATIVE_TYPE_RULE)));
  rb_define_const(SwigClassAlternative.klass, "SOLVER_ALTERNATIVE_TYPE_RECOMMENDS", SWIG_From_int((int)(SOLVER_ALTERNATIVE_TYPE_RECOMMENDS)));
  rb_define_const(SwigClassAlternative.klass, "SOLVER_ALTERNATIVE_TYPE_SUGGESTS", SWIG_From_int((int)(SOLVER_ALTERNATIVE_TYPE_SUGGESTS)));
  rb_define_method(SwigClassAlternative.klass, "chosen", _wrap_Alternative_chosen_get, -1);
  rb_define_method(SwigClassAlternative.klass, "rule", _wrap_Alternative_rule_get, -1);
  rb_define_method(SwigClassAlternative.klass, "depsolvable", _wrap_Alternative_depsolvable_get, -1);
  rb_define_method(SwigClassAlternative.klass, "dep", _wrap_Alternative_dep_get, -1);
  rb_define_method(SwigClassAlternative.klass, "choices_raw", _wrap_Alternative_choices_raw, -1);
  rb_define_method(SwigClassAlternative.klass, "choices", _wrap_Alternative_choices, -1);
  rb_define_method(SwigClassAlternative.klass, "to_s", _wrap_Alternative_to_s, -1);
  SwigClassAlternative.mark = 0;
  SwigClassAlternative.destroy = (void (*)(void *)) free_Alternative;
  SwigClassAlternative.trackObjects = 0;
  
  SwigClassTransaction.klass = rb_define_class_under(mSolv, "Transaction", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_Transaction, (void *) &SwigClassTransaction);
  rb_undef_alloc_func(SwigClassTransaction.klass);
  rb_define_method(SwigClassTransaction.klass, "pool", _wrap_Transaction_pool_get, -1);
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_IGNORE", SWIG_From_int((int)(SOLVER_TRANSACTION_IGNORE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_ERASE", SWIG_From_int((int)(SOLVER_TRANSACTION_ERASE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_REINSTALLED", SWIG_From_int((int)(SOLVER_TRANSACTION_REINSTALLED)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_DOWNGRADED", SWIG_From_int((int)(SOLVER_TRANSACTION_DOWNGRADED)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_CHANGED", SWIG_From_int((int)(SOLVER_TRANSACTION_CHANGED)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_UPGRADED", SWIG_From_int((int)(SOLVER_TRANSACTION_UPGRADED)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_OBSOLETED", SWIG_From_int((int)(SOLVER_TRANSACTION_OBSOLETED)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_INSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_INSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_REINSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_REINSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_DOWNGRADE", SWIG_From_int((int)(SOLVER_TRANSACTION_DOWNGRADE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_CHANGE", SWIG_From_int((int)(SOLVER_TRANSACTION_CHANGE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_UPGRADE", SWIG_From_int((int)(SOLVER_TRANSACTION_UPGRADE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_OBSOLETES", SWIG_From_int((int)(SOLVER_TRANSACTION_OBSOLETES)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_MULTIINSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_MULTIINSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_MULTIREINSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_MULTIREINSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_MAXTYPE", SWIG_From_int((int)(SOLVER_TRANSACTION_MAXTYPE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_SHOW_ACTIVE", SWIG_From_int((int)(SOLVER_TRANSACTION_SHOW_ACTIVE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_SHOW_ALL", SWIG_From_int((int)(SOLVER_TRANSACTION_SHOW_ALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_SHOW_OBSOLETES", SWIG_From_int((int)(SOLVER_TRANSACTION_SHOW_OBSOLETES)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_SHOW_MULTIINSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_SHOW_MULTIINSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_CHANGE_IS_REINSTALL", SWIG_From_int((int)(SOLVER_TRANSACTION_CHANGE_IS_REINSTALL)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE", SWIG_From_int((int)(SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_MERGE_VENDORCHANGES", SWIG_From_int((int)(SOLVER_TRANSACTION_MERGE_VENDORCHANGES)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_MERGE_ARCHCHANGES", SWIG_From_int((int)(SOLVER_TRANSACTION_MERGE_ARCHCHANGES)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_RPM_ONLY", SWIG_From_int((int)(SOLVER_TRANSACTION_RPM_ONLY)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_ARCHCHANGE", SWIG_From_int((int)(SOLVER_TRANSACTION_ARCHCHANGE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_VENDORCHANGE", SWIG_From_int((int)(SOLVER_TRANSACTION_VENDORCHANGE)));
  rb_define_const(SwigClassTransaction.klass, "SOLVER_TRANSACTION_KEEP_ORDERDATA", SWIG_From_int((int)(SOLVER_TRANSACTION_KEEP_ORDERDATA)));
  rb_define_method(SwigClassTransaction.klass, "isempty?", _wrap_Transaction_isemptyq___, -1);
  rb_define_method(SwigClassTransaction.klass, "othersolvable", _wrap_Transaction_othersolvable, -1);
  rb_define_method(SwigClassTransaction.klass, "allothersolvables", _wrap_Transaction_allothersolvables, -1);
  rb_define_method(SwigClassTransaction.klass, "classify", _wrap_Transaction_classify, -1);
  rb_define_method(SwigClassTransaction.klass, "newpackages", _wrap_Transaction_newpackages, -1);
  rb_define_method(SwigClassTransaction.klass, "keptpackages", _wrap_Transaction_keptpackages, -1);
  rb_define_method(SwigClassTransaction.klass, "newsolvables", _wrap_Transaction_newsolvables, -1);
  rb_define_method(SwigClassTransaction.klass, "keptsolvables", _wrap_Transaction_keptsolvables, -1);
  rb_define_method(SwigClassTransaction.klass, "steps", _wrap_Transaction_steps, -1);
  rb_define_method(SwigClassTransaction.klass, "steptype", _wrap_Transaction_steptype, -1);
  rb_define_method(SwigClassTransaction.klass, "calc_installsizechange", _wrap_Transaction_calc_installsizechange, -1);
  rb_define_method(SwigClassTransaction.klass, "order", _wrap_Transaction_order, -1);
  SwigClassTransaction.mark = 0;
  SwigClassTransaction.destroy = (void (*)(void *)) free_Transaction;
  SwigClassTransaction.trackObjects = 0;
  
  SwigClassTransactionClass.klass = rb_define_class_under(mSolv, "TransactionClass", rb_cObject);
  SWIG_TypeClientData(SWIGTYPE_p_TransactionClass, (void *) &SwigClassTransactionClass);
  rb_define_alloc_func(SwigClassTransactionClass.klass, _wrap_TransactionClass_allocate);
  rb_define_method(SwigClassTransactionClass.klass, "initialize", _wrap_new_TransactionClass, -1);
  rb_define_method(SwigClassTransactionClass.klass, "transaction", _wrap_TransactionClass_transaction_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "type", _wrap_TransactionClass_type_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "fromid", _wrap_TransactionClass_fromid_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "toid", _wrap_TransactionClass_toid_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "count", _wrap_TransactionClass_count_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "solvables", _wrap_TransactionClass_solvables, -1);
  rb_define_method(SwigClassTransactionClass.klass, "fromstr", _wrap_TransactionClass_fromstr_get, -1);
  rb_define_method(SwigClassTransactionClass.klass, "tostr", _wrap_TransactionClass_tostr_get, -1);
  SwigClassTransactionClass.mark = 0;
  SwigClassTransactionClass.destroy = (void (*)(void *)) free_TransactionClass;
  SwigClassTransactionClass.trackObjects = 0;
}

