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

#define SWIGLUA

/* -----------------------------------------------------------------------------
 *  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 (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

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

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

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

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


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

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

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

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

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

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

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

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


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

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

   Now you can be more explicit:

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

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

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

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

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

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

       int food(double)
       int fooi(int);

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

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

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

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

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


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef __cplusplus
}
#endif

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

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

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

typedef struct {
  const char     *name;
  lua_CFunction   method;
} swig_lua_method;

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

typedef struct swig_lua_class {
  const char    *name;
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

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

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

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

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

/* Contract support */
#define SWIG_contract_assert(expr, msg)  \
  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else

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


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

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

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

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

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

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

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

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

/* the module.get method used for getting linked data */
SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  printf("SWIG_Lua_module_get %p(%s) '%s'\n",
   lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
   lua_tostring(L,2));
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get");  /* get the .get table */
  lua_remove(L,3);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .get table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,3);  /* remove .get */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_call(L,0,1);
      return 1;
    }
    lua_pop(L,1);  /* remove the top */
  }
  lua_pop(L,1);  /* remove the .get */
  lua_pushnil(L);  /* return a nil */
    return 1;
}

/* the module.set method used for setting linked data */
SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
*/
  /* get the metatable */
  assert(lua_istable(L,1));  /* just in case */
  lua_getmetatable(L,1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".set");  /* get the .set table */
  lua_remove(L,4);  /* remove metatable */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,4);  /* remove .set */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
  }
  lua_settop(L,3);  /* reset back to start */
  /* we now have the table, key & new value, so just set directly */
  lua_rawset(L,1);  /* add direct */
  return 0;
}

/* registering a module in lua */
SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushstring(L,name);
  lua_newtable(L);   /* the table */
  /* add meta table */
  lua_newtable(L);    /* the meta table */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
  lua_pushstring(L,".get");
  lua_newtable(L);    /* the .get table */
  lua_rawset(L,-3);  /* add .get into metatable */
  lua_pushstring(L,".set");
  lua_newtable(L);    /* the .set table */
  lua_rawset(L,-3);  /* add .set into metatable */
  lua_setmetatable(L,-2);  /* sets meta table in module */
  lua_rawset(L,-3);        /* add module into parent */
  SWIG_Lua_get_table(L,name);   /* get the table back out */
}

/* ending the register */
SWIGINTERN void  SWIG_Lua_module_end(lua_State* L)
{
  lua_pop(L,1);       /* tidy stack (remove module) */
}

/* adding a linked variable to the module */
SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_getmetatable(L,-1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* should be a table: */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)  /* if there is a set fn */
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* should be a table: */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
  lua_pop(L,1);       /* tidy stack (remove meta) */
}

/* adding a function module */
SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
{
  SWIG_Lua_add_function(L,name,fn);
}

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

/* the class.get method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  /* look for the key in the .get table */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* NEW: looks for the __getitem() fn
  this is a user provided get fn */
  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;  /* sorry not known */
}

/* the class.set method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
      lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
      lua_tostring(L,2),
      lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/

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

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

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

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

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

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

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
{
  int i;
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_details(L,clss->bases[i]);
  }
  /* add fns */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  }
  /* add methods to the metatable */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->methods[i].name;i++){
    SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /*   add operator overloads
    these look ANY method which start with "__" and assume they
    are operator overloads & add them to the metatable
    (this might mess up is someone defines a method __gc (the destructor)*/
  for(i=0;clss->methods[i].name;i++){
    if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
      SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
    }
  }
}

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

/* performs the entire class registration process */
SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
{
  /*  add its constructor to module with the name of the class
  so you can do MyClass(...) as well as new_MyClass(...)
  BUT only if a constructor is defined
  (this overcomes the problem of pure virtual classes without constructors)*/
  if (clss->constructor)
    SWIG_Lua_add_function(L,clss->name,clss->constructor);

  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->name);  /* get the name */
  lua_newtable(L);    /* create the metatable */
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->name);
  lua_rawset(L,-3);
  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  /* add it */
  lua_rawset(L,-3);  /* metatable into registry */
  lua_pop(L,1);      /* tidy stack (remove registry) */

  SWIG_Lua_get_class_metatable(L,clss->name);
  SWIG_Lua_add_class_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
}

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

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

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

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

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

/* pushes a packed userdata. user for member fn pointers only */
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  assert(ptr); /* not acceptable to pass in a NULL value */
  raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
  raw->type=type;
  raw->own=0;
  memcpy(raw->data,ptr,size); /* copy the data */
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}
    
/* converts a packed userdata. user for member fn pointers only */
SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
  if (!raw) return SWIG_ERROR;  /* error */
  if (type==0 || type==raw->type) /* void* or identical type */
  {
    memcpy(ptr,raw->data,size); /* copy it */
    return SWIG_OK; /* ok */
  }
  return SWIG_ERROR;  /* error */
}

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

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

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

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

/* Install Constants */
SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
  int i;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_LUA_INT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_FLOAT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].dvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_CHAR:
      lua_pushstring(L,constants[i].name);
      lua_pushfstring(L,"%c",(char)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_STRING:
      lua_pushstring(L,constants[i].name);
      lua_pushstring(L,(char *) constants[i].pvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_POINTER:
      lua_pushstring(L,constants[i].name);
      SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_BINARY:
      lua_pushstring(L,constants[i].name);
      SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
      lua_rawset(L,-3);
      break;
    default:
      break;
    }
  }
}

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

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

#ifdef __cplusplus
}
#endif

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


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

#define SWIGTYPE_p_librdf_digest_s swig_types[0]
#define SWIGTYPE_p_librdf_hash_s swig_types[1]
#define SWIGTYPE_p_librdf_iterator_s swig_types[2]
#define SWIGTYPE_p_librdf_log_func swig_types[3]
#define SWIGTYPE_p_librdf_log_message swig_types[4]
#define SWIGTYPE_p_librdf_model_s swig_types[5]
#define SWIGTYPE_p_librdf_node_s swig_types[6]
#define SWIGTYPE_p_librdf_parser_s swig_types[7]
#define SWIGTYPE_p_librdf_query swig_types[8]
#define SWIGTYPE_p_librdf_query_results swig_types[9]
#define SWIGTYPE_p_librdf_serializer_s swig_types[10]
#define SWIGTYPE_p_librdf_statement_s swig_types[11]
#define SWIGTYPE_p_librdf_storage_s swig_types[12]
#define SWIGTYPE_p_librdf_stream_s swig_types[13]
#define SWIGTYPE_p_librdf_uri_s swig_types[14]
#define SWIGTYPE_p_librdf_world_s swig_types[15]
#define SWIGTYPE_p_p_char swig_types[16]
#define SWIGTYPE_p_raptor_locator swig_types[17]
static swig_type_info *swig_types[19];
static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

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

#define SWIG_name      "redland"
#define SWIG_init      luaopen_redland
#define SWIG_init_user luaopen_redland_user

#define SWIG_LUACODE   luaopen_redland_luacode


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

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

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

SWIG_DECLARE_TYPEMAP_ARR_FN(int,int);
SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int);
SWIG_DECLARE_TYPEMAP_ARR_FN(short,short);
SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short);
SWIG_DECLARE_TYPEMAP_ARR_FN(long,long);
SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long);
SWIG_DECLARE_TYPEMAP_ARR_FN(float,float);
SWIG_DECLARE_TYPEMAP_ARR_FN(double,double);

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



/* compile-time include (inside a % ... % block) */
#ifdef REDLAND_PRE_I
#include <redland-pre.i>
#endif

#include <redland.h>

/* 
 * Thanks to the patch in this Debian bug for the solution
 * to the crash inside vsnprintf on some architectures.
 *
 * "reuse of args inside the while(1) loop is in violation of the
 * specs and only happens to work by accident on other systems."
 *
 * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=104325 
 */

#ifndef va_copy
#ifdef __va_copy
#define va_copy(dest,src) __va_copy(dest,src)
#else
#define va_copy(dest,src) (dest) = (src)
#endif
#endif

/* compile-time include (inside a % ... % block) */
#ifdef REDLAND_POST_I
#include <redland-post.i>
#endif

/* Internal prototypes */
/* FOR TESTING ERRORS ONLY - NOT PART OF API */
void librdf_internal_test_error(librdf_world *world);
void librdf_internal_test_warning(librdf_world *world);


/* prototypes for internal routines called below - NOT PART OF API */
void librdf_test_error(librdf_world* world, const char* message);
void librdf_test_warning(librdf_world* world, const char* message);

/* FOR TESTING ERRORS ONLY - NOT PART OF API */
void
librdf_internal_test_error(librdf_world *world) 
{
  librdf_test_error(world, "test error message number 1.");
}

void
librdf_internal_test_warning(librdf_world *world) 
{
  librdf_test_warning(world, "test warning message number 2.");
}


#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_librdf_new_digest(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_digest *result = 0 ;
  
  SWIG_check_num_args("librdf_new_digest",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_digest",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_digest",2,"char *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_digest",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (librdf_digest *)librdf_new_digest(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_digest_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_digest(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  
  SWIG_check_num_args("librdf_free_digest",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_digest",1,"librdf_digest *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_free_digest",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  librdf_free_digest(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_digest_init(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  
  SWIG_check_num_args("librdf_digest_init",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_digest_init",1,"librdf_digest *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_digest_init",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  librdf_digest_init(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_digest_update(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  
  SWIG_check_num_args("librdf_digest_update",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_digest_update",1,"librdf_digest *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_digest_update",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("librdf_digest_update",3,"size_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_digest_update",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  librdf_digest_update(arg1,(char const *)arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_digest_update_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("librdf_digest_update_string",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_digest_update_string",1,"librdf_digest *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_digest_update_string",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_digest_update_string",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  librdf_digest_update_string(arg1,(char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_digest_final(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  
  SWIG_check_num_args("librdf_digest_final",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_digest_final",1,"librdf_digest *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_digest_final",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  librdf_digest_final(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_digest_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_digest_to_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_digest_to_string",1,"librdf_digest *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_digest_s,0))){
    SWIG_fail_ptr("librdf_digest_to_string",1,SWIGTYPE_p_librdf_digest_s);
  }
  
  result = (char *)librdf_digest_to_string(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_hash_from_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_hash *result = 0 ;
  
  SWIG_check_num_args("librdf_new_hash_from_string",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_hash_from_string",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_hash_from_string",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_hash_from_string",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_hash_from_string",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  result = (librdf_hash *)librdf_new_hash_from_string(arg1,(char const *)arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_hash_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_hash_from_array_of_strings(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char **arg3 = (char **) 0 ;
  librdf_hash *result = 0 ;
  
  SWIG_check_num_args("librdf_new_hash_from_array_of_strings",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_hash_from_array_of_strings",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_hash_from_array_of_strings",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_new_hash_from_array_of_strings",3,"char const **");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_hash_from_array_of_strings",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_p_char,0))){
    SWIG_fail_ptr("librdf_new_hash_from_array_of_strings",3,SWIGTYPE_p_p_char);
  }
  
  result = (librdf_hash *)librdf_new_hash_from_array_of_strings(arg1,(char const *)arg2,(char const **)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_hash_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_hash_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_hash *arg1 = (librdf_hash *) 0 ;
  char **arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_hash_to_string",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_hash_to_string",1,"librdf_hash *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_hash_to_string",2,"char const *[]");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_hash_s,0))){
    SWIG_fail_ptr("librdf_hash_to_string",1,SWIGTYPE_p_librdf_hash_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p_char,0))){
    SWIG_fail_ptr("librdf_hash_to_string",2,SWIGTYPE_p_p_char);
  }
  
  result = (char *)librdf_hash_to_string(arg1,(char const *(*))arg2);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_hash(lua_State* L) {
  int SWIG_arg = 0;
  librdf_hash *arg1 = (librdf_hash *) 0 ;
  
  SWIG_check_num_args("librdf_free_hash",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_hash",1,"librdf_hash *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_hash_s,0))){
    SWIG_fail_ptr("librdf_free_hash",1,SWIGTYPE_p_librdf_hash_s);
  }
  
  librdf_free_hash(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_world(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *result = 0 ;
  
  SWIG_check_num_args("librdf_new_world",0,0)
  result = (librdf_world *)librdf_new_world();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_world_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_world(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  
  SWIG_check_num_args("librdf_free_world",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_world",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_free_world",1,SWIGTYPE_p_librdf_world_s);
  }
  
  librdf_free_world(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_world_open(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  
  SWIG_check_num_args("librdf_world_open",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_world_open",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_world_open",1,SWIGTYPE_p_librdf_world_s);
  }
  
  librdf_world_open(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_world_get_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_world_get_feature",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_world_get_feature",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_world_get_feature",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_world_get_feature",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_world_get_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_world_get_feature(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_world_set_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_world_set_feature",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_world_set_feature",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_world_set_feature",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_world_set_feature",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_world_set_feature",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_world_set_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_world_set_feature",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_world_set_feature(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_get_accept_header(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_get_accept_header",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_get_accept_header",1,"librdf_parser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_get_accept_header",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  result = (char *)librdf_parser_get_accept_header(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_world_set_logger(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *arg2 = (void *) 0 ;
  librdf_log_func arg3 ;
  librdf_log_func *argp3 ;
  
  SWIG_check_num_args("librdf_world_set_logger",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_world_set_logger",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_world_set_logger",2,"void *");
  if(!lua_isuserdata(L,3)) SWIG_fail_arg("librdf_world_set_logger",3,"librdf_log_func");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_world_set_logger",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"librdf_world_set_logger");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_librdf_log_func,0))){
    SWIG_fail_ptr("librdf_world_set_logger",3,SWIGTYPE_p_librdf_log_func);
  }
  arg3 = *argp3;
  
  librdf_world_set_logger(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_iterator(lua_State* L) {
  int SWIG_arg = 0;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  
  SWIG_check_num_args("librdf_free_iterator",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_iterator",1,"librdf_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_iterator_s,0))){
    SWIG_fail_ptr("librdf_free_iterator",1,SWIGTYPE_p_librdf_iterator_s);
  }
  
  librdf_free_iterator(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_iterator_end(lua_State* L) {
  int SWIG_arg = 0;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_iterator_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_iterator_end",1,"librdf_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_iterator_s,0))){
    SWIG_fail_ptr("librdf_iterator_end",1,SWIGTYPE_p_librdf_iterator_s);
  }
  
  result = (int)librdf_iterator_end(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_iterator_get_object(lua_State* L) {
  int SWIG_arg = 0;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_iterator_get_object",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_iterator_get_object",1,"librdf_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_iterator_s,0))){
    SWIG_fail_ptr("librdf_iterator_get_object",1,SWIGTYPE_p_librdf_iterator_s);
  }
  
  result = (librdf_node *)librdf_iterator_get_object(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_iterator_get_context(lua_State* L) {
  int SWIG_arg = 0;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_iterator_get_context",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_iterator_get_context",1,"librdf_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_iterator_s,0))){
    SWIG_fail_ptr("librdf_iterator_get_context",1,SWIGTYPE_p_librdf_iterator_s);
  }
  
  result = (librdf_node *)librdf_iterator_get_context(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_iterator_next(lua_State* L) {
  int SWIG_arg = 0;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_iterator_next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_iterator_next",1,"librdf_iterator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_iterator_s,0))){
    SWIG_fail_ptr("librdf_iterator_next",1,SWIGTYPE_p_librdf_iterator_s);
  }
  
  result = (int)librdf_iterator_next(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_new_uri",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_uri",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_uri",2,"char *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_uri",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (librdf_uri *)librdf_new_uri(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_uri_from_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_new_uri_from_uri",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_uri_from_uri",1,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_uri_from_uri",1,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_uri *)librdf_new_uri_from_uri(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_uri_from_filename(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_new_uri_from_filename",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_uri_from_filename",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_uri_from_filename",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_uri_from_filename",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (librdf_uri *)librdf_new_uri_from_filename(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  
  SWIG_check_num_args("librdf_free_uri",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_uri",1,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_free_uri",1,SWIGTYPE_p_librdf_uri_s);
  }
  
  librdf_free_uri(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_uri_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_uri_to_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_uri_to_string",1,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_uri_to_string",1,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (char *)librdf_uri_to_string(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_uri_equals(lua_State* L) {
  int SWIG_arg = 0;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_uri_equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_uri_equals",1,"librdf_uri *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_uri_equals",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_uri_equals",1,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_uri_equals",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (int)librdf_uri_equals(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_uri_compare(lua_State* L) {
  int SWIG_arg = 0;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_uri_compare",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_uri_compare",1,"librdf_uri *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_uri_compare",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_uri_compare",1,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_uri_compare",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (int)librdf_uri_compare(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node",1,SWIGTYPE_p_librdf_world_s);
  }
  
  result = (librdf_node *)librdf_new_node(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_uri_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_uri_string",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_uri_string",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_node_from_uri_string",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_uri_string",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (librdf_node *)librdf_new_node_from_uri_string(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_uri",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_uri",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_new_node_from_uri",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_uri",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_uri",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_new_node_from_uri(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_uri_local_name(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_uri_local_name",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_uri_local_name",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_new_node_from_uri_local_name",2,"librdf_uri *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_node_from_uri_local_name",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_uri_local_name",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_uri_local_name",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  arg3 = (char *)lua_tostring(L, 3);
  result = (librdf_node *)librdf_new_node_from_uri_local_name(arg1,arg2,(char const *)arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_normalised_uri_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_normalised_uri_string",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_normalised_uri_string",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_node_from_normalised_uri_string",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_new_node_from_normalised_uri_string",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_new_node_from_normalised_uri_string",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_normalised_uri_string",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_normalised_uri_string",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_normalised_uri_string",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_new_node_from_normalised_uri_string(arg1,(char const *)arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_literal(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) NULL ;
  int arg4 = (int) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_literal",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_literal",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_node_from_literal",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("librdf_new_node_from_literal",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("librdf_new_node_from_literal",4,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_literal",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (int)lua_tonumber(L, 4);
  }
  result = (librdf_node *)librdf_new_node_from_literal(arg1,(char const *)arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_typed_literal(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) NULL ;
  librdf_uri *arg4 = (librdf_uri *) NULL ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_typed_literal",2,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_typed_literal",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_node_from_typed_literal",2,"char const *");
  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("librdf_new_node_from_typed_literal",3,"char const *");
  if(lua_gettop(L)>=4 && !SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_new_node_from_typed_literal",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_typed_literal",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
      SWIG_fail_ptr("librdf_new_node_from_typed_literal",4,SWIGTYPE_p_librdf_uri_s);
    }
  }
  result = (librdf_node *)librdf_new_node_from_typed_literal(arg1,(char const *)arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_node(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_node",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_node",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_node",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_node *)librdf_new_node_from_node(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_node_from_blank_identifier(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) NULL ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_new_node_from_blank_identifier",1,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_node_from_blank_identifier",1,"librdf_world *");
  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("librdf_new_node_from_blank_identifier",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_node_from_blank_identifier",1,SWIGTYPE_p_librdf_world_s);
  }
  
  if(lua_gettop(L)>=2){
    arg2 = (char *)lua_tostring(L, 2);
  }
  result = (librdf_node *)librdf_new_node_from_blank_identifier(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_node(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  
  SWIG_check_num_args("librdf_free_node",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_node",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_free_node",1,SWIGTYPE_p_librdf_node_s);
  }
  
  librdf_free_node(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_uri",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_uri",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_uri",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_uri *)librdf_node_get_uri(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_type(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_get_type",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_type",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_type",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_get_type(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_literal_value(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_literal_value",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_literal_value",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_literal_value",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (char *)librdf_node_get_literal_value(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_literal_value_as_latin1(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_literal_value_as_latin1",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_literal_value_as_latin1",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_literal_value_as_latin1",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (char *)librdf_node_get_literal_value_as_latin1(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_literal_value_language(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_literal_value_language",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_literal_value_language",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_literal_value_language",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (char *)librdf_node_get_literal_value_language(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_literal_value_datatype_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_literal_value_datatype_uri",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_literal_value_datatype_uri",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_literal_value_datatype_uri",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_uri *)librdf_node_get_literal_value_datatype_uri(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_literal_value_is_wf_xml(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_get_literal_value_is_wf_xml",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_literal_value_is_wf_xml",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_literal_value_is_wf_xml",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_get_literal_value_is_wf_xml(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_li_ordinal(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_get_li_ordinal",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_li_ordinal",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_li_ordinal",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_get_li_ordinal(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_node_to_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_to_string",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_to_string",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (char *)librdf_node_to_string(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_get_blank_identifier(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_node_get_blank_identifier",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_get_blank_identifier",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_get_blank_identifier",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (char *)librdf_node_get_blank_identifier(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_is_resource(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_is_resource",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_is_resource",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_is_resource",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_is_resource(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_is_literal(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_is_literal",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_is_literal",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_is_literal",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_is_literal(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_is_blank(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_is_blank",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_is_blank",1,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_is_blank",1,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_is_blank(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_node_equals(lua_State* L) {
  int SWIG_arg = 0;
  librdf_node *arg1 = (librdf_node *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_node_equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_node_equals",1,"librdf_node *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_node_equals",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_equals",1,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_node_equals",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_node_equals(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_statement *result = 0 ;
  
  SWIG_check_num_args("librdf_new_statement",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_statement",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_statement",1,SWIGTYPE_p_librdf_world_s);
  }
  
  result = (librdf_statement *)librdf_new_statement(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_statement_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_statement_from_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_statement *result = 0 ;
  
  SWIG_check_num_args("librdf_new_statement_from_statement",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_statement_from_statement",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_new_statement_from_statement",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (librdf_statement *)librdf_new_statement_from_statement(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_statement_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_statement_from_nodes(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *arg4 = (librdf_node *) 0 ;
  librdf_statement *result = 0 ;
  
  SWIG_check_num_args("librdf_new_statement_from_nodes",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_statement_from_nodes",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_new_statement_from_nodes",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_new_statement_from_nodes",3,"librdf_node *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_new_statement_from_nodes",4,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_statement_from_nodes",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_new_statement_from_nodes",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_new_statement_from_nodes",3,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_new_statement_from_nodes",4,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_statement *)librdf_new_statement_from_nodes(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_statement_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  
  SWIG_check_num_args("librdf_free_statement",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_statement",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_free_statement",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  librdf_free_statement(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_get_subject(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_statement_get_subject",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_get_subject",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_get_subject",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (librdf_node *)librdf_statement_get_subject(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_set_subject(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  
  SWIG_check_num_args("librdf_statement_set_subject",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_set_subject",1,"librdf_statement *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_statement_set_subject",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_set_subject",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_statement_set_subject",2,SWIGTYPE_p_librdf_node_s);
  }
  
  librdf_statement_set_subject(arg1,arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_get_predicate(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_statement_get_predicate",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_get_predicate",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_get_predicate",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (librdf_node *)librdf_statement_get_predicate(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_set_predicate(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  
  SWIG_check_num_args("librdf_statement_set_predicate",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_set_predicate",1,"librdf_statement *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_statement_set_predicate",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_set_predicate",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_statement_set_predicate",2,SWIGTYPE_p_librdf_node_s);
  }
  
  librdf_statement_set_predicate(arg1,arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_get_object(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_statement_get_object",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_get_object",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_get_object",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (librdf_node *)librdf_statement_get_object(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_set_object(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  
  SWIG_check_num_args("librdf_statement_set_object",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_set_object",1,"librdf_statement *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_statement_set_object",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_set_object",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_statement_set_object",2,SWIGTYPE_p_librdf_node_s);
  }
  
  librdf_statement_set_object(arg1,arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_equals(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_statement_equals",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_equals",1,"librdf_statement *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_statement_equals",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_equals",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_equals",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_statement_equals(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_match(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_statement_match",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_match",1,"librdf_statement *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_statement_match",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_match",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_match",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_statement_match(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_statement_to_string",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_to_string",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_to_string",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (char *)librdf_statement_to_string(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_statement_is_complete(lua_State* L) {
  int SWIG_arg = 0;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_statement_is_complete",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_statement_is_complete",1,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_statement_is_complete",1,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_statement_is_complete(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_storage *arg2 = (librdf_storage *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_model *result = 0 ;
  
  SWIG_check_num_args("librdf_new_model",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_model",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_new_model",2,"librdf_storage *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_model",3,"char *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_model",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_storage_s,0))){
    SWIG_fail_ptr("librdf_new_model",2,SWIGTYPE_p_librdf_storage_s);
  }
  
  arg3 = (char *)lua_tostring(L, 3);
  result = (librdf_model *)librdf_new_model(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_model_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_model_with_options(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_storage *arg2 = (librdf_storage *) 0 ;
  librdf_hash *arg3 = (librdf_hash *) 0 ;
  librdf_model *result = 0 ;
  
  SWIG_check_num_args("librdf_new_model_with_options",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_model_with_options",1,"librdf_world *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_new_model_with_options",2,"librdf_storage *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_new_model_with_options",3,"librdf_hash *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_model_with_options",1,SWIGTYPE_p_librdf_world_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_storage_s,0))){
    SWIG_fail_ptr("librdf_new_model_with_options",2,SWIGTYPE_p_librdf_storage_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_hash_s,0))){
    SWIG_fail_ptr("librdf_new_model_with_options",3,SWIGTYPE_p_librdf_hash_s);
  }
  
  result = (librdf_model *)librdf_new_model_with_options(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_model_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_model_from_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_model *result = 0 ;
  
  SWIG_check_num_args("librdf_new_model_from_model",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_model_from_model",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_new_model_from_model",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (librdf_model *)librdf_new_model_from_model(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_model_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  
  SWIG_check_num_args("librdf_free_model",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_model",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_free_model",1,SWIGTYPE_p_librdf_model_s);
  }
  
  librdf_free_model(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_size(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_size",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_size",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_size",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_model_size(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_add(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *arg4 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_add",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_add",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_add",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_add",3,"librdf_node *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_model_add",4,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_add",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add",3,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add",4,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_add(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_add_string_literal_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  char *arg4 = (char *) 0 ;
  char *arg5 = (char *) NULL ;
  int arg6 = (int) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_add_string_literal_statement",4,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_add_string_literal_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_add_string_literal_statement",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_add_string_literal_statement",3,"librdf_node *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("librdf_model_add_string_literal_statement",4,"char const *");
  if(lua_gettop(L)>=5 && !lua_isstring(L,5)) SWIG_fail_arg("librdf_model_add_string_literal_statement",5,"char const *");
  if(lua_gettop(L)>=6 && !lua_isnumber(L,6)) SWIG_fail_arg("librdf_model_add_string_literal_statement",6,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_add_string_literal_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add_string_literal_statement",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add_string_literal_statement",3,SWIGTYPE_p_librdf_node_s);
  }
  
  arg4 = (char *)lua_tostring(L, 4);
  if(lua_gettop(L)>=5){
    arg5 = (char *)lua_tostring(L, 5);
  }
  if(lua_gettop(L)>=6){
    arg6 = (int)lua_tonumber(L, 6);
  }
  result = (int)librdf_model_add_string_literal_statement(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_add_typed_literal_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  char *arg4 = (char *) 0 ;
  char *arg5 = (char *) 0 ;
  librdf_uri *arg6 = (librdf_uri *) NULL ;
  int result;
  
  SWIG_check_num_args("librdf_model_add_typed_literal_statement",5,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",3,"librdf_node *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",4,"char *");
  if(!lua_isstring(L,5)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",5,"char *");
  if(lua_gettop(L)>=6 && !SWIG_isptrtype(L,6)) SWIG_fail_arg("librdf_model_add_typed_literal_statement",6,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_add_typed_literal_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add_typed_literal_statement",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_add_typed_literal_statement",3,SWIGTYPE_p_librdf_node_s);
  }
  
  arg4 = (char *)lua_tostring(L, 4);
  arg5 = (char *)lua_tostring(L, 5);
  if(lua_gettop(L)>=6){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,6,(void**)&arg6,SWIGTYPE_p_librdf_uri_s,0))){
      SWIG_fail_ptr("librdf_model_add_typed_literal_statement",6,SWIGTYPE_p_librdf_uri_s);
    }
  }
  result = (int)librdf_model_add_typed_literal_statement(arg1,arg2,arg3,arg4,arg5,arg6);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_add_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_add_statement",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_add_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_add_statement",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_add_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_add_statement",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_model_add_statement(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_add_statements(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_stream *arg2 = (librdf_stream *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_add_statements",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_add_statements",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_add_statements",2,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_add_statements",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_model_add_statements",2,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (int)librdf_model_add_statements(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_remove_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_remove_statement",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_remove_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_remove_statement",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_remove_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_remove_statement",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_model_remove_statement(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_contains_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_contains_statement",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_contains_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_contains_statement",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_contains_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_contains_statement",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_model_contains_statement(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_model_as_stream",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_as_stream",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_as_stream",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (librdf_stream *)librdf_model_as_stream(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_find_statements(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_model_find_statements",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_find_statements",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_find_statements",2,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_find_statements",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_find_statements",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (librdf_stream *)librdf_model_find_statements(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_find_statements_in_context(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  librdf_node *arg3 = (librdf_node *) NULL ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_model_find_statements_in_context",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_find_statements_in_context",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_find_statements_in_context",2,"librdf_statement *");
  if(lua_gettop(L)>=3 && !SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_find_statements_in_context",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_find_statements_in_context",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_find_statements_in_context",2,SWIGTYPE_p_librdf_statement_s);
  }
  
  if(lua_gettop(L)>=3){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
      SWIG_fail_ptr("librdf_model_find_statements_in_context",3,SWIGTYPE_p_librdf_node_s);
    }
  }
  result = (librdf_stream *)librdf_model_find_statements_in_context(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_sources(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_sources",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_sources",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_sources",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_sources",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_sources",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_sources",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_sources",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_sources(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_arcs(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_arcs",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_arcs",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_arcs",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_arcs",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_arcs(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_targets(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_targets",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_targets",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_targets",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_targets",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_targets",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_targets",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_targets",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_targets(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_source(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_source",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_source",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_source",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_source",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_source",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_source",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_source",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_node *)librdf_model_get_source(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_arc(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_arc",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_arc",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_arc",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_arc",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_arc",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arc",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arc",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_node *)librdf_model_get_arc(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_arcs_out(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_arcs_out",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_arcs_out",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_arcs_out",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs_out",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs_out",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_arcs_out(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_arcs_in(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_arcs_in",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_arcs_in",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_arcs_in",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs_in",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_arcs_in",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_arcs_in(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_has_arc_in(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_has_arc_in",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_has_arc_in",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_has_arc_in",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_has_arc_in",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_in",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_in",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_in",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_has_arc_in(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_has_arc_out(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_has_arc_out",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_has_arc_out",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_has_arc_out",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_has_arc_out",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_out",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_out",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_has_arc_out",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_has_arc_out(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_target(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_target",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_target",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_target",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_get_target",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_target",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_target",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_get_target",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_node *)librdf_model_get_target(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_context_add_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_statement *arg3 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_context_add_statement",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_context_add_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_context_add_statement",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_context_add_statement",3,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statement",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statement",3,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_model_context_add_statement(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_context_add_statements(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_stream *arg3 = (librdf_stream *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_context_add_statements",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_context_add_statements",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_context_add_statements",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_context_add_statements",3,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statements",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statements",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_model_context_add_statements",3,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (int)librdf_model_context_add_statements(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_context_remove_statement(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_statement *arg3 = (librdf_statement *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_context_remove_statement",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_context_remove_statement",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_context_remove_statement",2,"librdf_node *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_context_remove_statement",3,"librdf_statement *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_context_remove_statement",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_context_remove_statement",2,SWIGTYPE_p_librdf_node_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_statement_s,0))){
    SWIG_fail_ptr("librdf_model_context_remove_statement",3,SWIGTYPE_p_librdf_statement_s);
  }
  
  result = (int)librdf_model_context_remove_statement(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_context_remove_statements(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_context_remove_statements",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_context_remove_statements",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_context_remove_statements",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_context_remove_statements",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_context_remove_statements",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_context_remove_statements(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_context_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_model_context_as_stream",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_context_as_stream",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_context_as_stream",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_context_as_stream",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_context_as_stream",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (librdf_stream *)librdf_model_context_as_stream(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_sync(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  
  SWIG_check_num_args("librdf_model_sync",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_sync",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_sync",1,SWIGTYPE_p_librdf_model_s);
  }
  
  librdf_model_sync(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_contexts(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_iterator *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_contexts",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_contexts",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_contexts",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (librdf_iterator *)librdf_model_get_contexts(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_iterator_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_contains_context(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_contains_context",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_contains_context",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_contains_context",2,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_contains_context",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_contains_context",2,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_contains_context(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_get_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_model_get_feature",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_get_feature",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_get_feature",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_get_feature",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_model_get_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_model_get_feature(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_set_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_set_feature",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_set_feature",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_set_feature",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_model_set_feature",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_set_feature",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_model_set_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_model_set_feature",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_model_set_feature(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_load(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) NULL ;
  char *arg4 = (char *) NULL ;
  librdf_uri *arg5 = (librdf_uri *) NULL ;
  int result;
  
  SWIG_check_num_args("librdf_model_load",2,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_load",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_load",2,"librdf_uri *");
  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("librdf_model_load",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("librdf_model_load",4,"char const *");
  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_model_load",5,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_load",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_model_load",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (char *)lua_tostring(L, 4);
  }
  if(lua_gettop(L)>=5){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_uri_s,0))){
      SWIG_fail_ptr("librdf_model_load",5,SWIGTYPE_p_librdf_uri_s);
    }
  }
  result = (int)librdf_model_load(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_query_execute(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_query *arg2 = (librdf_query *) 0 ;
  librdf_query_results *result = 0 ;
  
  SWIG_check_num_args("librdf_model_query_execute",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_query_execute",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_query_execute",2,"librdf_query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_query_execute",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_model_query_execute",2,SWIGTYPE_p_librdf_query);
  }
  
  result = (librdf_query_results *)librdf_model_query_execute(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_query_results,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) NULL ;
  char *arg4 = (char *) NULL ;
  librdf_uri *arg5 = (librdf_uri *) NULL ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_model_to_string",2,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_to_string",1,"librdf_model *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_model_to_string",2,"librdf_uri *");
  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("librdf_model_to_string",3,"char const *");
  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("librdf_model_to_string",4,"char const *");
  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_model_to_string",5,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_to_string",1,SWIGTYPE_p_librdf_model_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_model_to_string",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  if(lua_gettop(L)>=3){
    arg3 = (char *)lua_tostring(L, 3);
  }
  if(lua_gettop(L)>=4){
    arg4 = (char *)lua_tostring(L, 4);
  }
  if(lua_gettop(L)>=5){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_uri_s,0))){
      SWIG_fail_ptr("librdf_model_to_string",5,SWIGTYPE_p_librdf_uri_s);
    }
  }
  result = (char *)librdf_model_to_string(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_transaction_start(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_transaction_start",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_transaction_start",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_transaction_start",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_model_transaction_start(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_transaction_commit(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_transaction_commit",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_transaction_commit",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_transaction_commit",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_model_transaction_commit(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_model_transaction_rollback(lua_State* L) {
  int SWIG_arg = 0;
  librdf_model *arg1 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_model_transaction_rollback",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_model_transaction_rollback",1,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_model_transaction_rollback",1,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_model_transaction_rollback(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_storage(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  librdf_storage *result = 0 ;
  
  SWIG_check_num_args("librdf_new_storage",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_storage",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_storage",2,"char *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_storage",3,"char *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("librdf_new_storage",4,"char *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_storage",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  result = (librdf_storage *)librdf_new_storage(arg1,arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_storage_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_storage_from_storage(lua_State* L) {
  int SWIG_arg = 0;
  librdf_storage *arg1 = (librdf_storage *) 0 ;
  librdf_storage *result = 0 ;
  
  SWIG_check_num_args("librdf_new_storage_from_storage",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_storage_from_storage",1,"librdf_storage *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_storage_s,0))){
    SWIG_fail_ptr("librdf_new_storage_from_storage",1,SWIGTYPE_p_librdf_storage_s);
  }
  
  result = (librdf_storage *)librdf_new_storage_from_storage(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_storage_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_storage(lua_State* L) {
  int SWIG_arg = 0;
  librdf_storage *arg1 = (librdf_storage *) 0 ;
  
  SWIG_check_num_args("librdf_free_storage",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_storage",1,"librdf_storage *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_storage_s,0))){
    SWIG_fail_ptr("librdf_free_storage",1,SWIGTYPE_p_librdf_storage_s);
  }
  
  librdf_free_storage(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_check_name(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_check_name",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_check_name",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_check_name",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_parser_check_name",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (int)librdf_parser_check_name(arg1,(char const *)arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_parser(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_parser *result = 0 ;
  
  SWIG_check_num_args("librdf_new_parser",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_parser",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_parser",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_parser",3,"char const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_new_parser",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_parser",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_parser",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_parser *)librdf_new_parser(arg1,(char const *)arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_parser_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_parser(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  
  SWIG_check_num_args("librdf_free_parser",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_parser",1,"librdf_parser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_free_parser",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  librdf_free_parser(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) NULL ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_parse_as_stream",2,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_as_stream",1,"librdf_parser *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_parser_parse_as_stream",2,"librdf_uri *");
  if(lua_gettop(L)>=3 && !SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_parser_parse_as_stream",3,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_as_stream",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_as_stream",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  if(lua_gettop(L)>=3){
    if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
      SWIG_fail_ptr("librdf_parser_parse_as_stream",3,SWIGTYPE_p_librdf_uri_s);
    }
  }
  result = (librdf_stream *)librdf_parser_parse_as_stream(arg1,arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_into_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_parse_into_model",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_into_model",1,"librdf_parser *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_parser_parse_into_model",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_parser_parse_into_model",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_parser_parse_into_model",4,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_into_model",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_into_model",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_into_model",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_into_model",4,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_parser_parse_into_model(arg1,arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_string_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_parse_string_as_stream",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_string_as_stream",1,"librdf_parser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_parse_string_as_stream",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_parser_parse_string_as_stream",3,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_string_as_stream",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_string_as_stream",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_stream *)librdf_parser_parse_string_as_stream(arg1,(char const *)arg2,arg3);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_string_into_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_parse_string_into_model",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_string_into_model",1,"librdf_parser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_parse_string_into_model",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_parser_parse_string_into_model",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_parser_parse_string_into_model",4,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_string_into_model",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_string_into_model",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_string_into_model",4,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_parser_parse_string_into_model(arg1,(char const *)arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_counted_string_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_parse_counted_string_as_stream",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_counted_string_as_stream",1,"librdf_parser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_parse_counted_string_as_stream",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("librdf_parser_parse_counted_string_as_stream",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_parser_parse_counted_string_as_stream",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_counted_string_as_stream",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_counted_string_as_stream",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_stream *)librdf_parser_parse_counted_string_as_stream(arg1,(char const *)arg2,arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_parse_counted_string_into_model(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_model *arg5 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_parse_counted_string_into_model",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_parse_counted_string_into_model",1,"librdf_parser *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_parse_counted_string_into_model",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("librdf_parser_parse_counted_string_into_model",3,"size_t");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_parser_parse_counted_string_into_model",4,"librdf_uri *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_parser_parse_counted_string_into_model",5,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_counted_string_into_model",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative")
  arg3 = (size_t)lua_tonumber(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_counted_string_into_model",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_parser_parse_counted_string_into_model",5,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_parser_parse_counted_string_into_model(arg1,(char const *)arg2,arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_get_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_get_feature",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_get_feature",1,"librdf_parser *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_parser_get_feature",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_get_feature",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_get_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_parser_get_feature(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_set_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_set_feature",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_set_feature",1,"librdf_parser *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_parser_set_feature",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_parser_set_feature",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_set_feature",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_parser_set_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_parser_set_feature",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_parser_set_feature(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_guess_name(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_guess_name",3,3)
  if(!lua_isstring(L,1)) SWIG_fail_arg("librdf_parser_guess_name",1,"char const *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_guess_name",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_parser_guess_name",3,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  result = (char *)librdf_parser_guess_name((char const *)arg1,(char const *)arg2,(char const *)arg3);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_guess_name2(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_guess_name2",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_guess_name2",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_parser_guess_name2",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_parser_guess_name2",3,"char const *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("librdf_parser_guess_name2",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_parser_guess_name2",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  result = (char *)librdf_parser_guess_name2(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_get_namespaces_seen_prefix(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  int arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_get_namespaces_seen_prefix",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_get_namespaces_seen_prefix",1,"librdf_parser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_parser_get_namespaces_seen_prefix",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_get_namespaces_seen_prefix",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (char *)librdf_parser_get_namespaces_seen_prefix(arg1,arg2);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_get_namespaces_seen_uri(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  int arg2 ;
  librdf_uri *result = 0 ;
  
  SWIG_check_num_args("librdf_parser_get_namespaces_seen_uri",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_get_namespaces_seen_uri",1,"librdf_parser *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_parser_get_namespaces_seen_uri",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_get_namespaces_seen_uri",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (librdf_uri *)librdf_parser_get_namespaces_seen_uri(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_uri_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_parser_get_namespaces_seen_count(lua_State* L) {
  int SWIG_arg = 0;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_parser_get_namespaces_seen_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_parser_get_namespaces_seen_count",1,"librdf_parser *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_parser_s,0))){
    SWIG_fail_ptr("librdf_parser_get_namespaces_seen_count",1,SWIGTYPE_p_librdf_parser_s);
  }
  
  result = (int)librdf_parser_get_namespaces_seen_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_query(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  char *arg4 = (char *) 0 ;
  librdf_uri *arg5 = (librdf_uri *) 0 ;
  librdf_query *result = 0 ;
  
  SWIG_check_num_args("librdf_new_query",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_query",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_query",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_new_query",3,"librdf_uri *");
  if(!lua_isstring(L,4)) SWIG_fail_arg("librdf_new_query",4,"char const *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_new_query",5,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_query",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_query",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  arg4 = (char *)lua_tostring(L, 4);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_query",5,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_query *)librdf_new_query(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_query_from_query(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  librdf_query *result = 0 ;
  
  SWIG_check_num_args("librdf_new_query_from_query",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_query_from_query",1,"librdf_query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_new_query_from_query",1,SWIGTYPE_p_librdf_query);
  }
  
  result = (librdf_query *)librdf_new_query_from_query(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_query,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_query(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  
  SWIG_check_num_args("librdf_free_query",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_query",1,"librdf_query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_free_query",1,SWIGTYPE_p_librdf_query);
  }
  
  librdf_free_query(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_execute(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  librdf_model *arg2 = (librdf_model *) 0 ;
  librdf_query_results *result = 0 ;
  
  SWIG_check_num_args("librdf_query_execute",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_execute",1,"librdf_query *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_query_execute",2,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_query_execute",1,SWIGTYPE_p_librdf_query);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_query_execute",2,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (librdf_query_results *)librdf_query_execute(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_query_results,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_get_limit(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_get_limit",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_get_limit",1,"librdf_query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_query_get_limit",1,SWIGTYPE_p_librdf_query);
  }
  
  result = (int)librdf_query_get_limit(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_set_limit(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("librdf_query_set_limit",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_set_limit",1,"librdf_query *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_query_set_limit",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_query_set_limit",1,SWIGTYPE_p_librdf_query);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)librdf_query_set_limit(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_get_offset(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_get_offset",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_get_offset",1,"librdf_query *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_query_get_offset",1,SWIGTYPE_p_librdf_query);
  }
  
  result = (int)librdf_query_get_offset(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_set_offset(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int arg2 ;
  int result;
  
  SWIG_check_num_args("librdf_query_set_offset",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_set_offset",1,"librdf_query *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_query_set_offset",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query,0))){
    SWIG_fail_ptr("librdf_query_set_offset",1,SWIGTYPE_p_librdf_query);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (int)librdf_query_set_offset(arg1,arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_as_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  librdf_stream *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_as_stream",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_as_stream",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_as_stream",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (librdf_stream *)librdf_query_results_as_stream(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_stream_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_count(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_get_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_count",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_count",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_get_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_next(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_next",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_next",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_next(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_finished(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_finished",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_finished",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_finished",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_finished(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_binding_value(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int arg2 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_get_binding_value",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_binding_value",1,"librdf_query_results *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_query_results_get_binding_value",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_binding_value",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (librdf_node *)librdf_query_results_get_binding_value(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_binding_name(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int arg2 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_get_binding_name",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_binding_name",1,"librdf_query_results *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("librdf_query_results_get_binding_name",2,"int");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_binding_name",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (int)lua_tonumber(L, 2);
  result = (char *)librdf_query_results_get_binding_name(arg1,arg2);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_binding_value_by_name(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_get_binding_value_by_name",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_binding_value_by_name",1,"librdf_query_results *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_query_results_get_binding_value_by_name",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_binding_value_by_name",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (librdf_node *)librdf_query_results_get_binding_value_by_name(arg1,(char const *)arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_bindings_count(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_get_bindings_count",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_bindings_count",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_bindings_count",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_get_bindings_count(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_to_file(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_to_file",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_to_file",1,"librdf_query_results *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_query_results_to_file",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_query_results_to_file",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_query_results_to_file",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_to_file",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_file",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_file",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (int)librdf_query_results_to_file(arg1,(char const *)arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_to_file2(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_uri *arg5 = (librdf_uri *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_to_file2",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_to_file2",1,"librdf_query_results *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_query_results_to_file2",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_query_results_to_file2",3,"char const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_query_results_to_file2",4,"librdf_uri *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_query_results_to_file2",5,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_to_file2",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_file2",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_file2",5,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (int)librdf_query_results_to_file2(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_to_string",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_to_string",1,"librdf_query_results *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_query_results_to_string",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_query_results_to_string",3,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_to_string",1,SWIGTYPE_p_librdf_query_results);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_string",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_string",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (char *)librdf_query_results_to_string(arg1,arg2,arg3);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_to_string2(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_uri *arg5 = (librdf_uri *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_query_results_to_string2",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_to_string2",1,"librdf_query_results *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_query_results_to_string2",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_query_results_to_string2",3,"char const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_query_results_to_string2",4,"librdf_uri *");
  if(!SWIG_isptrtype(L,5)) SWIG_fail_arg("librdf_query_results_to_string2",5,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_to_string2",1,SWIGTYPE_p_librdf_query_results);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_string2",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_query_results_to_string2",5,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (char *)librdf_query_results_to_string2(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_query_results(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  
  SWIG_check_num_args("librdf_free_query_results",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_query_results",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_free_query_results",1,SWIGTYPE_p_librdf_query_results);
  }
  
  librdf_free_query_results(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_is_bindings(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_is_bindings",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_is_bindings",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_is_bindings",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_is_bindings(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_is_boolean(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_is_boolean",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_is_boolean",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_is_boolean",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_is_boolean(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_is_graph(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_is_graph",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_is_graph",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_is_graph",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_is_graph(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_is_syntax(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_is_syntax",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_is_syntax",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_is_syntax",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_is_syntax(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_query_results_get_boolean(lua_State* L) {
  int SWIG_arg = 0;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_query_results_get_boolean",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_query_results_get_boolean",1,"librdf_query_results *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_query_results,0))){
    SWIG_fail_ptr("librdf_query_results_get_boolean",1,SWIGTYPE_p_librdf_query_results);
  }
  
  result = (int)librdf_query_results_get_boolean(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_check_name(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_serializer_check_name",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_check_name",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_serializer_check_name",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_serializer_check_name",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (int)librdf_serializer_check_name(arg1,(char const *)arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_new_serializer(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  librdf_serializer *result = 0 ;
  
  SWIG_check_num_args("librdf_new_serializer",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_new_serializer",1,"librdf_world *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_new_serializer",2,"char const *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_new_serializer",3,"char const *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_new_serializer",4,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_new_serializer",1,SWIGTYPE_p_librdf_world_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_new_serializer",4,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_serializer *)librdf_new_serializer(arg1,(char const *)arg2,(char const *)arg3,arg4);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_serializer_s,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_serializer(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  
  SWIG_check_num_args("librdf_free_serializer",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_serializer",1,"librdf_serializer *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_free_serializer",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  librdf_free_serializer(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_serialize_stream_to_file(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_stream *arg4 = (librdf_stream *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_serializer_serialize_stream_to_file",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_file",1,"librdf_serializer *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_file",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_file",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_file",4,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_file",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_file",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_file",4,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (int)librdf_serializer_serialize_stream_to_file(arg1,(char const *)arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_serialize_model_to_file(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_serializer_serialize_model_to_file",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_serialize_model_to_file",1,"librdf_serializer *");
  if(!lua_isstring(L,2)) SWIG_fail_arg("librdf_serializer_serialize_model_to_file",2,"char const *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_serializer_serialize_model_to_file",3,"librdf_uri *");
  if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("librdf_serializer_serialize_model_to_file",4,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_file",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_file",3,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_file",4,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (int)librdf_serializer_serialize_model_to_file(arg1,(char const *)arg2,arg3,arg4);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_serialize_stream_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_stream *arg3 = (librdf_stream *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_serializer_serialize_stream_to_string",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_string",1,"librdf_serializer *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_string",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_serializer_serialize_stream_to_string",3,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_string",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_string",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_stream_to_string",3,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (char *)librdf_serializer_serialize_stream_to_string(arg1,arg2,arg3);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_serialize_model_to_string(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_model *arg3 = (librdf_model *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_serializer_serialize_model_to_string",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_serialize_model_to_string",1,"librdf_serializer *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_serializer_serialize_model_to_string",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_serializer_serialize_model_to_string",3,"librdf_model *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_string",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_string",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_model_s,0))){
    SWIG_fail_ptr("librdf_serializer_serialize_model_to_string",3,SWIGTYPE_p_librdf_model_s);
  }
  
  result = (char *)librdf_serializer_serialize_model_to_string(arg1,arg2,arg3);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  free(result);
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_get_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_serializer_get_feature",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_get_feature",1,"librdf_serializer *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_serializer_get_feature",2,"librdf_uri *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_get_feature",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_get_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  result = (librdf_node *)librdf_serializer_get_feature(arg1,arg2);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_set_feature(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_serializer_set_feature",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_set_feature",1,"librdf_serializer *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_serializer_set_feature",2,"librdf_uri *");
  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("librdf_serializer_set_feature",3,"librdf_node *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_set_feature",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_set_feature",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_librdf_node_s,0))){
    SWIG_fail_ptr("librdf_serializer_set_feature",3,SWIGTYPE_p_librdf_node_s);
  }
  
  result = (int)librdf_serializer_set_feature(arg1,arg2,arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_serializer_set_namespace(lua_State* L) {
  int SWIG_arg = 0;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_serializer_set_namespace",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_serializer_set_namespace",1,"librdf_serializer *");
  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("librdf_serializer_set_namespace",2,"librdf_uri *");
  if(!lua_isstring(L,3)) SWIG_fail_arg("librdf_serializer_set_namespace",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_serializer_s,0))){
    SWIG_fail_ptr("librdf_serializer_set_namespace",1,SWIGTYPE_p_librdf_serializer_s);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_librdf_uri_s,0))){
    SWIG_fail_ptr("librdf_serializer_set_namespace",2,SWIGTYPE_p_librdf_uri_s);
  }
  
  arg3 = (char *)lua_tostring(L, 3);
  result = (int)librdf_serializer_set_namespace(arg1,arg2,(char const *)arg3);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_free_stream(lua_State* L) {
  int SWIG_arg = 0;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  
  SWIG_check_num_args("librdf_free_stream",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_free_stream",1,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_free_stream",1,SWIGTYPE_p_librdf_stream_s);
  }
  
  librdf_free_stream(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_stream_end(lua_State* L) {
  int SWIG_arg = 0;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_stream_end",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_stream_end",1,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_stream_end",1,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (int)librdf_stream_end(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_stream_next(lua_State* L) {
  int SWIG_arg = 0;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_stream_next",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_stream_next",1,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_stream_next",1,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (int)librdf_stream_next(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_stream_get_object(lua_State* L) {
  int SWIG_arg = 0;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  librdf_statement *result = 0 ;
  
  SWIG_check_num_args("librdf_stream_get_object",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_stream_get_object",1,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_stream_get_object",1,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (librdf_statement *)librdf_stream_get_object(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_statement_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_stream_get_context(lua_State* L) {
  int SWIG_arg = 0;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  librdf_node *result = 0 ;
  
  SWIG_check_num_args("librdf_stream_get_context",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_stream_get_context",1,"librdf_stream *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_stream_s,0))){
    SWIG_fail_ptr("librdf_stream_get_context",1,SWIGTYPE_p_librdf_stream_s);
  }
  
  result = (librdf_node *)librdf_stream_get_context(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_librdf_node_s,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_log_message_code(lua_State* L) {
  int SWIG_arg = 0;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_log_message_code",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_log_message_code",1,"librdf_log_message *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_log_message,0))){
    SWIG_fail_ptr("librdf_log_message_code",1,SWIGTYPE_p_librdf_log_message);
  }
  
  result = (int)librdf_log_message_code(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_log_message_level(lua_State* L) {
  int SWIG_arg = 0;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_log_message_level",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_log_message_level",1,"librdf_log_message *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_log_message,0))){
    SWIG_fail_ptr("librdf_log_message_level",1,SWIGTYPE_p_librdf_log_message);
  }
  
  result = (int)librdf_log_message_level(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_log_message_facility(lua_State* L) {
  int SWIG_arg = 0;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  int result;
  
  SWIG_check_num_args("librdf_log_message_facility",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_log_message_facility",1,"librdf_log_message *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_log_message,0))){
    SWIG_fail_ptr("librdf_log_message_facility",1,SWIGTYPE_p_librdf_log_message);
  }
  
  result = (int)librdf_log_message_facility(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_log_message_message(lua_State* L) {
  int SWIG_arg = 0;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_log_message_message",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_log_message_message",1,"librdf_log_message *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_log_message,0))){
    SWIG_fail_ptr("librdf_log_message_message",1,SWIGTYPE_p_librdf_log_message);
  }
  
  result = (char *)librdf_log_message_message(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_log_message_locator(lua_State* L) {
  int SWIG_arg = 0;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  raptor_locator *result = 0 ;
  
  SWIG_check_num_args("librdf_log_message_locator",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_log_message_locator",1,"librdf_log_message *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_log_message,0))){
    SWIG_fail_ptr("librdf_log_message_locator",1,SWIGTYPE_p_librdf_log_message);
  }
  
  result = (raptor_locator *)librdf_log_message_locator(arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_raptor_locator,0); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_locator_line(lua_State* L) {
  int SWIG_arg = 0;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  int result;
  
  SWIG_check_num_args("raptor_locator_line",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raptor_locator_line",1,"raptor_locator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_raptor_locator,0))){
    SWIG_fail_ptr("raptor_locator_line",1,SWIGTYPE_p_raptor_locator);
  }
  
  result = (int)raptor_locator_line(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_locator_column(lua_State* L) {
  int SWIG_arg = 0;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  int result;
  
  SWIG_check_num_args("raptor_locator_column",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raptor_locator_column",1,"raptor_locator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_raptor_locator,0))){
    SWIG_fail_ptr("raptor_locator_column",1,SWIGTYPE_p_raptor_locator);
  }
  
  result = (int)raptor_locator_column(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_locator_byte(lua_State* L) {
  int SWIG_arg = 0;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  int result;
  
  SWIG_check_num_args("raptor_locator_byte",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raptor_locator_byte",1,"raptor_locator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_raptor_locator,0))){
    SWIG_fail_ptr("raptor_locator_byte",1,SWIGTYPE_p_raptor_locator);
  }
  
  result = (int)raptor_locator_byte(arg1);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_locator_file(lua_State* L) {
  int SWIG_arg = 0;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("raptor_locator_file",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raptor_locator_file",1,"raptor_locator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_raptor_locator,0))){
    SWIG_fail_ptr("raptor_locator_file",1,SWIGTYPE_p_raptor_locator);
  }
  
  result = (char *)raptor_locator_file(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_locator_uri(lua_State* L) {
  int SWIG_arg = 0;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("raptor_locator_uri",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raptor_locator_uri",1,"raptor_locator *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_raptor_locator,0))){
    SWIG_fail_ptr("raptor_locator_uri",1,SWIGTYPE_p_raptor_locator);
  }
  
  result = (char *)raptor_locator_uri(arg1);
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_internal_test_error(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  
  SWIG_check_num_args("librdf_internal_test_error",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_internal_test_error",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_internal_test_error",1,SWIGTYPE_p_librdf_world_s);
  }
  
  librdf_internal_test_error(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_internal_test_warning(lua_State* L) {
  int SWIG_arg = 0;
  librdf_world *arg1 = (librdf_world *) 0 ;
  
  SWIG_check_num_args("librdf_internal_test_warning",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("librdf_internal_test_warning",1,"librdf_world *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_librdf_world_s,0))){
    SWIG_fail_ptr("librdf_internal_test_warning",1,SWIGTYPE_p_librdf_world_s);
  }
  
  librdf_internal_test_warning(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_short_copyright_string_get(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_short_copyright_string",0,0)
  result = (char *)(char *)librdf_short_copyright_string;
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_copyright_string_get(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_copyright_string",0,0)
  result = (char *)(char *)librdf_copyright_string;
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_version_string_get(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("librdf_version_string",0,0)
  result = (char *)(char *)librdf_version_string;
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_version_major_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("librdf_version_major",0,0)
  result = (unsigned int)(unsigned int)librdf_version_major;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_version_minor_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("librdf_version_minor",0,0)
  result = (unsigned int)(unsigned int)librdf_version_minor;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_version_release_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("librdf_version_release",0,0)
  result = (unsigned int)(unsigned int)librdf_version_release;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_librdf_version_decimal_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("librdf_version_decimal",0,0)
  result = (unsigned int)(unsigned int)librdf_version_decimal;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_version_string_get(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("raptor_version_string",0,0)
  result = (char *)(char *)raptor_version_string;
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_version_major_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("raptor_version_major",0,0)
  result = (unsigned int)(unsigned int)raptor_version_major;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_version_minor_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("raptor_version_minor",0,0)
  result = (unsigned int)(unsigned int)raptor_version_minor;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_version_release_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("raptor_version_release",0,0)
  result = (unsigned int)(unsigned int)raptor_version_release;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_raptor_version_decimal_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("raptor_version_decimal",0,0)
  result = (unsigned int)(unsigned int)raptor_version_decimal;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_rasqal_version_string_get(lua_State* L) {
  int SWIG_arg = 0;
  char *result = 0 ;
  
  SWIG_check_num_args("rasqal_version_string",0,0)
  result = (char *)(char *)rasqal_version_string;
  lua_pushstring(L,(const char*)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_rasqal_version_major_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("rasqal_version_major",0,0)
  result = (unsigned int)(unsigned int)rasqal_version_major;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_rasqal_version_minor_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("rasqal_version_minor",0,0)
  result = (unsigned int)(unsigned int)rasqal_version_minor;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_rasqal_version_release_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("rasqal_version_release",0,0)
  result = (unsigned int)(unsigned int)rasqal_version_release;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_rasqal_version_decimal_get(lua_State* L) {
  int SWIG_arg = 0;
  unsigned int result;
  
  SWIG_check_num_args("rasqal_version_decimal",0,0)
  result = (unsigned int)(unsigned int)rasqal_version_decimal;
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


#ifdef __cplusplus
}
#endif

static const struct luaL_reg swig_commands[] = {
    { "librdf_new_digest", _wrap_librdf_new_digest},
    { "librdf_free_digest", _wrap_librdf_free_digest},
    { "librdf_digest_init", _wrap_librdf_digest_init},
    { "librdf_digest_update", _wrap_librdf_digest_update},
    { "librdf_digest_update_string", _wrap_librdf_digest_update_string},
    { "librdf_digest_final", _wrap_librdf_digest_final},
    { "librdf_digest_to_string", _wrap_librdf_digest_to_string},
    { "librdf_new_hash_from_string", _wrap_librdf_new_hash_from_string},
    { "librdf_new_hash_from_array_of_strings", _wrap_librdf_new_hash_from_array_of_strings},
    { "librdf_hash_to_string", _wrap_librdf_hash_to_string},
    { "librdf_free_hash", _wrap_librdf_free_hash},
    { "librdf_new_world", _wrap_librdf_new_world},
    { "librdf_free_world", _wrap_librdf_free_world},
    { "librdf_world_open", _wrap_librdf_world_open},
    { "librdf_world_get_feature", _wrap_librdf_world_get_feature},
    { "librdf_world_set_feature", _wrap_librdf_world_set_feature},
    { "librdf_parser_get_accept_header", _wrap_librdf_parser_get_accept_header},
    { "librdf_world_set_logger", _wrap_librdf_world_set_logger},
    { "librdf_free_iterator", _wrap_librdf_free_iterator},
    { "librdf_iterator_end", _wrap_librdf_iterator_end},
    { "librdf_iterator_get_object", _wrap_librdf_iterator_get_object},
    { "librdf_iterator_get_context", _wrap_librdf_iterator_get_context},
    { "librdf_iterator_next", _wrap_librdf_iterator_next},
    { "librdf_new_uri", _wrap_librdf_new_uri},
    { "librdf_new_uri_from_uri", _wrap_librdf_new_uri_from_uri},
    { "librdf_new_uri_from_filename", _wrap_librdf_new_uri_from_filename},
    { "librdf_free_uri", _wrap_librdf_free_uri},
    { "librdf_uri_to_string", _wrap_librdf_uri_to_string},
    { "librdf_uri_equals", _wrap_librdf_uri_equals},
    { "librdf_uri_compare", _wrap_librdf_uri_compare},
    { "librdf_new_node", _wrap_librdf_new_node},
    { "librdf_new_node_from_uri_string", _wrap_librdf_new_node_from_uri_string},
    { "librdf_new_node_from_uri", _wrap_librdf_new_node_from_uri},
    { "librdf_new_node_from_uri_local_name", _wrap_librdf_new_node_from_uri_local_name},
    { "librdf_new_node_from_normalised_uri_string", _wrap_librdf_new_node_from_normalised_uri_string},
    { "librdf_new_node_from_literal", _wrap_librdf_new_node_from_literal},
    { "librdf_new_node_from_typed_literal", _wrap_librdf_new_node_from_typed_literal},
    { "librdf_new_node_from_node", _wrap_librdf_new_node_from_node},
    { "librdf_new_node_from_blank_identifier", _wrap_librdf_new_node_from_blank_identifier},
    { "librdf_free_node", _wrap_librdf_free_node},
    { "librdf_node_get_uri", _wrap_librdf_node_get_uri},
    { "librdf_node_get_type", _wrap_librdf_node_get_type},
    { "librdf_node_get_literal_value", _wrap_librdf_node_get_literal_value},
    { "librdf_node_get_literal_value_as_latin1", _wrap_librdf_node_get_literal_value_as_latin1},
    { "librdf_node_get_literal_value_language", _wrap_librdf_node_get_literal_value_language},
    { "librdf_node_get_literal_value_datatype_uri", _wrap_librdf_node_get_literal_value_datatype_uri},
    { "librdf_node_get_literal_value_is_wf_xml", _wrap_librdf_node_get_literal_value_is_wf_xml},
    { "librdf_node_get_li_ordinal", _wrap_librdf_node_get_li_ordinal},
    { "librdf_node_to_string", _wrap_librdf_node_to_string},
    { "librdf_node_get_blank_identifier", _wrap_librdf_node_get_blank_identifier},
    { "librdf_node_is_resource", _wrap_librdf_node_is_resource},
    { "librdf_node_is_literal", _wrap_librdf_node_is_literal},
    { "librdf_node_is_blank", _wrap_librdf_node_is_blank},
    { "librdf_node_equals", _wrap_librdf_node_equals},
    { "librdf_new_statement", _wrap_librdf_new_statement},
    { "librdf_new_statement_from_statement", _wrap_librdf_new_statement_from_statement},
    { "librdf_new_statement_from_nodes", _wrap_librdf_new_statement_from_nodes},
    { "librdf_free_statement", _wrap_librdf_free_statement},
    { "librdf_statement_get_subject", _wrap_librdf_statement_get_subject},
    { "librdf_statement_set_subject", _wrap_librdf_statement_set_subject},
    { "librdf_statement_get_predicate", _wrap_librdf_statement_get_predicate},
    { "librdf_statement_set_predicate", _wrap_librdf_statement_set_predicate},
    { "librdf_statement_get_object", _wrap_librdf_statement_get_object},
    { "librdf_statement_set_object", _wrap_librdf_statement_set_object},
    { "librdf_statement_equals", _wrap_librdf_statement_equals},
    { "librdf_statement_match", _wrap_librdf_statement_match},
    { "librdf_statement_to_string", _wrap_librdf_statement_to_string},
    { "librdf_statement_is_complete", _wrap_librdf_statement_is_complete},
    { "librdf_new_model", _wrap_librdf_new_model},
    { "librdf_new_model_with_options", _wrap_librdf_new_model_with_options},
    { "librdf_new_model_from_model", _wrap_librdf_new_model_from_model},
    { "librdf_free_model", _wrap_librdf_free_model},
    { "librdf_model_size", _wrap_librdf_model_size},
    { "librdf_model_add", _wrap_librdf_model_add},
    { "librdf_model_add_string_literal_statement", _wrap_librdf_model_add_string_literal_statement},
    { "librdf_model_add_typed_literal_statement", _wrap_librdf_model_add_typed_literal_statement},
    { "librdf_model_add_statement", _wrap_librdf_model_add_statement},
    { "librdf_model_add_statements", _wrap_librdf_model_add_statements},
    { "librdf_model_remove_statement", _wrap_librdf_model_remove_statement},
    { "librdf_model_contains_statement", _wrap_librdf_model_contains_statement},
    { "librdf_model_as_stream", _wrap_librdf_model_as_stream},
    { "librdf_model_find_statements", _wrap_librdf_model_find_statements},
    { "librdf_model_find_statements_in_context", _wrap_librdf_model_find_statements_in_context},
    { "librdf_model_get_sources", _wrap_librdf_model_get_sources},
    { "librdf_model_get_arcs", _wrap_librdf_model_get_arcs},
    { "librdf_model_get_targets", _wrap_librdf_model_get_targets},
    { "librdf_model_get_source", _wrap_librdf_model_get_source},
    { "librdf_model_get_arc", _wrap_librdf_model_get_arc},
    { "librdf_model_get_arcs_out", _wrap_librdf_model_get_arcs_out},
    { "librdf_model_get_arcs_in", _wrap_librdf_model_get_arcs_in},
    { "librdf_model_has_arc_in", _wrap_librdf_model_has_arc_in},
    { "librdf_model_has_arc_out", _wrap_librdf_model_has_arc_out},
    { "librdf_model_get_target", _wrap_librdf_model_get_target},
    { "librdf_model_context_add_statement", _wrap_librdf_model_context_add_statement},
    { "librdf_model_context_add_statements", _wrap_librdf_model_context_add_statements},
    { "librdf_model_context_remove_statement", _wrap_librdf_model_context_remove_statement},
    { "librdf_model_context_remove_statements", _wrap_librdf_model_context_remove_statements},
    { "librdf_model_context_as_stream", _wrap_librdf_model_context_as_stream},
    { "librdf_model_sync", _wrap_librdf_model_sync},
    { "librdf_model_get_contexts", _wrap_librdf_model_get_contexts},
    { "librdf_model_contains_context", _wrap_librdf_model_contains_context},
    { "librdf_model_get_feature", _wrap_librdf_model_get_feature},
    { "librdf_model_set_feature", _wrap_librdf_model_set_feature},
    { "librdf_model_load", _wrap_librdf_model_load},
    { "librdf_model_query_execute", _wrap_librdf_model_query_execute},
    { "librdf_model_to_string", _wrap_librdf_model_to_string},
    { "librdf_model_transaction_start", _wrap_librdf_model_transaction_start},
    { "librdf_model_transaction_commit", _wrap_librdf_model_transaction_commit},
    { "librdf_model_transaction_rollback", _wrap_librdf_model_transaction_rollback},
    { "librdf_new_storage", _wrap_librdf_new_storage},
    { "librdf_new_storage_from_storage", _wrap_librdf_new_storage_from_storage},
    { "librdf_free_storage", _wrap_librdf_free_storage},
    { "librdf_parser_check_name", _wrap_librdf_parser_check_name},
    { "librdf_new_parser", _wrap_librdf_new_parser},
    { "librdf_free_parser", _wrap_librdf_free_parser},
    { "librdf_parser_parse_as_stream", _wrap_librdf_parser_parse_as_stream},
    { "librdf_parser_parse_into_model", _wrap_librdf_parser_parse_into_model},
    { "librdf_parser_parse_string_as_stream", _wrap_librdf_parser_parse_string_as_stream},
    { "librdf_parser_parse_string_into_model", _wrap_librdf_parser_parse_string_into_model},
    { "librdf_parser_parse_counted_string_as_stream", _wrap_librdf_parser_parse_counted_string_as_stream},
    { "librdf_parser_parse_counted_string_into_model", _wrap_librdf_parser_parse_counted_string_into_model},
    { "librdf_parser_get_feature", _wrap_librdf_parser_get_feature},
    { "librdf_parser_set_feature", _wrap_librdf_parser_set_feature},
    { "librdf_parser_guess_name", _wrap_librdf_parser_guess_name},
    { "librdf_parser_guess_name2", _wrap_librdf_parser_guess_name2},
    { "librdf_parser_get_namespaces_seen_prefix", _wrap_librdf_parser_get_namespaces_seen_prefix},
    { "librdf_parser_get_namespaces_seen_uri", _wrap_librdf_parser_get_namespaces_seen_uri},
    { "librdf_parser_get_namespaces_seen_count", _wrap_librdf_parser_get_namespaces_seen_count},
    { "librdf_new_query", _wrap_librdf_new_query},
    { "librdf_new_query_from_query", _wrap_librdf_new_query_from_query},
    { "librdf_free_query", _wrap_librdf_free_query},
    { "librdf_query_execute", _wrap_librdf_query_execute},
    { "librdf_query_get_limit", _wrap_librdf_query_get_limit},
    { "librdf_query_set_limit", _wrap_librdf_query_set_limit},
    { "librdf_query_get_offset", _wrap_librdf_query_get_offset},
    { "librdf_query_set_offset", _wrap_librdf_query_set_offset},
    { "librdf_query_results_as_stream", _wrap_librdf_query_results_as_stream},
    { "librdf_query_results_get_count", _wrap_librdf_query_results_get_count},
    { "librdf_query_results_next", _wrap_librdf_query_results_next},
    { "librdf_query_results_finished", _wrap_librdf_query_results_finished},
    { "librdf_query_results_get_binding_value", _wrap_librdf_query_results_get_binding_value},
    { "librdf_query_results_get_binding_name", _wrap_librdf_query_results_get_binding_name},
    { "librdf_query_results_get_binding_value_by_name", _wrap_librdf_query_results_get_binding_value_by_name},
    { "librdf_query_results_get_bindings_count", _wrap_librdf_query_results_get_bindings_count},
    { "librdf_query_results_to_file", _wrap_librdf_query_results_to_file},
    { "librdf_query_results_to_file2", _wrap_librdf_query_results_to_file2},
    { "librdf_query_results_to_string", _wrap_librdf_query_results_to_string},
    { "librdf_query_results_to_string2", _wrap_librdf_query_results_to_string2},
    { "librdf_free_query_results", _wrap_librdf_free_query_results},
    { "librdf_query_results_is_bindings", _wrap_librdf_query_results_is_bindings},
    { "librdf_query_results_is_boolean", _wrap_librdf_query_results_is_boolean},
    { "librdf_query_results_is_graph", _wrap_librdf_query_results_is_graph},
    { "librdf_query_results_is_syntax", _wrap_librdf_query_results_is_syntax},
    { "librdf_query_results_get_boolean", _wrap_librdf_query_results_get_boolean},
    { "librdf_serializer_check_name", _wrap_librdf_serializer_check_name},
    { "librdf_new_serializer", _wrap_librdf_new_serializer},
    { "librdf_free_serializer", _wrap_librdf_free_serializer},
    { "librdf_serializer_serialize_stream_to_file", _wrap_librdf_serializer_serialize_stream_to_file},
    { "librdf_serializer_serialize_model_to_file", _wrap_librdf_serializer_serialize_model_to_file},
    { "librdf_serializer_serialize_stream_to_string", _wrap_librdf_serializer_serialize_stream_to_string},
    { "librdf_serializer_serialize_model_to_string", _wrap_librdf_serializer_serialize_model_to_string},
    { "librdf_serializer_get_feature", _wrap_librdf_serializer_get_feature},
    { "librdf_serializer_set_feature", _wrap_librdf_serializer_set_feature},
    { "librdf_serializer_set_namespace", _wrap_librdf_serializer_set_namespace},
    { "librdf_free_stream", _wrap_librdf_free_stream},
    { "librdf_stream_end", _wrap_librdf_stream_end},
    { "librdf_stream_next", _wrap_librdf_stream_next},
    { "librdf_stream_get_object", _wrap_librdf_stream_get_object},
    { "librdf_stream_get_context", _wrap_librdf_stream_get_context},
    { "librdf_log_message_code", _wrap_librdf_log_message_code},
    { "librdf_log_message_level", _wrap_librdf_log_message_level},
    { "librdf_log_message_facility", _wrap_librdf_log_message_facility},
    { "librdf_log_message_message", _wrap_librdf_log_message_message},
    { "librdf_log_message_locator", _wrap_librdf_log_message_locator},
    { "raptor_locator_line", _wrap_raptor_locator_line},
    { "raptor_locator_column", _wrap_raptor_locator_column},
    { "raptor_locator_byte", _wrap_raptor_locator_byte},
    { "raptor_locator_file", _wrap_raptor_locator_file},
    { "raptor_locator_uri", _wrap_raptor_locator_uri},
    { "librdf_internal_test_error", _wrap_librdf_internal_test_error},
    { "librdf_internal_test_warning", _wrap_librdf_internal_test_warning},
    {0,0}
};

static swig_lua_var_info swig_variables[] = {
    { "librdf_short_copyright_string", _wrap_librdf_short_copyright_string_get, SWIG_Lua_set_immutable },
    { "librdf_copyright_string", _wrap_librdf_copyright_string_get, SWIG_Lua_set_immutable },
    { "librdf_version_string", _wrap_librdf_version_string_get, SWIG_Lua_set_immutable },
    { "librdf_version_major", _wrap_librdf_version_major_get, SWIG_Lua_set_immutable },
    { "librdf_version_minor", _wrap_librdf_version_minor_get, SWIG_Lua_set_immutable },
    { "librdf_version_release", _wrap_librdf_version_release_get, SWIG_Lua_set_immutable },
    { "librdf_version_decimal", _wrap_librdf_version_decimal_get, SWIG_Lua_set_immutable },
    { "raptor_version_string", _wrap_raptor_version_string_get, SWIG_Lua_set_immutable },
    { "raptor_version_major", _wrap_raptor_version_major_get, SWIG_Lua_set_immutable },
    { "raptor_version_minor", _wrap_raptor_version_minor_get, SWIG_Lua_set_immutable },
    { "raptor_version_release", _wrap_raptor_version_release_get, SWIG_Lua_set_immutable },
    { "raptor_version_decimal", _wrap_raptor_version_decimal_get, SWIG_Lua_set_immutable },
    { "rasqal_version_string", _wrap_rasqal_version_string_get, SWIG_Lua_set_immutable },
    { "rasqal_version_major", _wrap_rasqal_version_major_get, SWIG_Lua_set_immutable },
    { "rasqal_version_minor", _wrap_rasqal_version_minor_get, SWIG_Lua_set_immutable },
    { "rasqal_version_release", _wrap_rasqal_version_release_get, SWIG_Lua_set_immutable },
    { "rasqal_version_decimal", _wrap_rasqal_version_decimal_get, SWIG_Lua_set_immutable },
    {0,0,0}
};

static swig_lua_const_info swig_constants[] = {
    {0,0,0,0,0,0}
};

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

static swig_type_info _swigt__p_librdf_digest_s = {"_p_librdf_digest_s", "struct librdf_digest_s *|librdf_digest *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_hash_s = {"_p_librdf_hash_s", "librdf_hash *|struct librdf_hash_s *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_iterator_s = {"_p_librdf_iterator_s", "struct librdf_iterator_s *|librdf_iterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_log_func = {"_p_librdf_log_func", "librdf_log_func *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_log_message = {"_p_librdf_log_message", "librdf_log_message *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_model_s = {"_p_librdf_model_s", "struct librdf_model_s *|librdf_model *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_node_s = {"_p_librdf_node_s", "struct librdf_node_s *|librdf_node *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_parser_s = {"_p_librdf_parser_s", "librdf_parser *|struct librdf_parser_s *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_query = {"_p_librdf_query", "librdf_query *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_query_results = {"_p_librdf_query_results", "librdf_query_results *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_serializer_s = {"_p_librdf_serializer_s", "struct librdf_serializer_s *|librdf_serializer *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_statement_s = {"_p_librdf_statement_s", "struct librdf_statement_s *|librdf_statement *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_storage_s = {"_p_librdf_storage_s", "struct librdf_storage_s *|librdf_storage *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_stream_s = {"_p_librdf_stream_s", "struct librdf_stream_s *|librdf_stream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_uri_s = {"_p_librdf_uri_s", "librdf_uri *|struct librdf_uri_s *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_librdf_world_s = {"_p_librdf_world_s", "struct librdf_world_s *|librdf_world *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_raptor_locator = {"_p_raptor_locator", "raptor_locator *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_librdf_digest_s,
  &_swigt__p_librdf_hash_s,
  &_swigt__p_librdf_iterator_s,
  &_swigt__p_librdf_log_func,
  &_swigt__p_librdf_log_message,
  &_swigt__p_librdf_model_s,
  &_swigt__p_librdf_node_s,
  &_swigt__p_librdf_parser_s,
  &_swigt__p_librdf_query,
  &_swigt__p_librdf_query_results,
  &_swigt__p_librdf_serializer_s,
  &_swigt__p_librdf_statement_s,
  &_swigt__p_librdf_storage_s,
  &_swigt__p_librdf_stream_s,
  &_swigt__p_librdf_uri_s,
  &_swigt__p_librdf_world_s,
  &_swigt__p_p_char,
  &_swigt__p_raptor_locator,
};

static swig_cast_info _swigc__p_librdf_digest_s[] = {  {&_swigt__p_librdf_digest_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_hash_s[] = {  {&_swigt__p_librdf_hash_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_iterator_s[] = {  {&_swigt__p_librdf_iterator_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_log_func[] = {  {&_swigt__p_librdf_log_func, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_log_message[] = {  {&_swigt__p_librdf_log_message, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_model_s[] = {  {&_swigt__p_librdf_model_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_node_s[] = {  {&_swigt__p_librdf_node_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_parser_s[] = {  {&_swigt__p_librdf_parser_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_query[] = {  {&_swigt__p_librdf_query, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_query_results[] = {  {&_swigt__p_librdf_query_results, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_serializer_s[] = {  {&_swigt__p_librdf_serializer_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_statement_s[] = {  {&_swigt__p_librdf_statement_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_storage_s[] = {  {&_swigt__p_librdf_storage_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_stream_s[] = {  {&_swigt__p_librdf_stream_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_uri_s[] = {  {&_swigt__p_librdf_uri_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_librdf_world_s[] = {  {&_swigt__p_librdf_world_s, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_raptor_locator[] = {  {&_swigt__p_raptor_locator, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_librdf_digest_s,
  _swigc__p_librdf_hash_s,
  _swigc__p_librdf_iterator_s,
  _swigc__p_librdf_log_func,
  _swigc__p_librdf_log_message,
  _swigc__p_librdf_model_s,
  _swigc__p_librdf_node_s,
  _swigc__p_librdf_parser_s,
  _swigc__p_librdf_query,
  _swigc__p_librdf_query_results,
  _swigc__p_librdf_serializer_s,
  _swigc__p_librdf_statement_s,
  _swigc__p_librdf_storage_s,
  _swigc__p_librdf_stream_s,
  _swigc__p_librdf_uri_s,
  _swigc__p_librdf_world_s,
  _swigc__p_p_char,
  _swigc__p_raptor_locator,
};


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

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

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

#if 0
#define SWIGRUNTIME_DEBUG
#endif


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

  clientdata = clientdata;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    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);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

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

  /* When multiple interpeters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

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

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

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

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

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

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

  if (init_run) return;
  init_run = 1;

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

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



/* Forward declaration of where the user's %init{} gets inserted */
void SWIG_init_user(lua_State* L );
    
#ifdef __cplusplus
extern "C" {
#endif
/* this is the initialization function
  added at the very end of the code
  the function is always called SWIG_init, but an eariler #define will rename it
*/
SWIGEXPORT int SWIG_init(lua_State* L)
{
  int i;
  /* start with global table */
  lua_pushvalue(L,LUA_GLOBALSINDEX);
  /* SWIG's internal initalisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
  /* begin the module (its a table with the same name as the module) */
  SWIG_Lua_module_begin(L,SWIG_name);
  /* add commands/functions */
  for (i = 0; swig_commands[i].name; i++){
    SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
  }
  /* add variables */
  for (i = 0; swig_variables[i].name; i++){
    SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
  }
  /* set up base class pointers (the hierachy) */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* additional registration structs & classes in lua */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* constants */
  SWIG_Lua_InstallConstants(L,swig_constants);
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  lua_pop(L,1);  /* tidy stack (remove module table)*/
  lua_pop(L,1);  /* tidy stack (remove global table)*/
  return 1;
}

#ifdef __cplusplus
}
#endif


const char* SWIG_LUACODE=
  "";

void SWIG_init_user(lua_State* L)
{
  /* compile-time include (inside a % ... % block) */
#ifdef REDLAND_INIT_I
#include <redland-init.i>
#endif
  
  /* exec Lua code if applicable */
  SWIG_Lua_dostring(L,SWIG_LUACODE);
}

