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


#ifndef SWIGR
#define SWIGR
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

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

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

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


/*
   Flags/methods for returning states.

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

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

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

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

   Now you can be more explicit:

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

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

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

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

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

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

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

       int food(double)
       int fooi(int);

   and you call

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

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

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

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

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


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef __cplusplus
}
#endif


/* Remove global namespace pollution */
#if !defined(SWIG_NO_R_NO_REMAP)
# define R_NO_REMAP
#endif
#if !defined(SWIG_NO_STRICT_R_HEADERS)
# define STRICT_R_HEADERS
#endif

#include <Rdefines.h>
#include <Rversion.h>

#ifdef __cplusplus
#include <exception>
extern "C" {
#endif

/* for raw pointer */
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_R_NewPointerObj(ptr, type, flags)

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#if R_VERSION >= R_Version(2,6,0)
#define VMAXTYPE void *
#else
#define VMAXTYPE char *
#endif

/*
  This is mainly a way to avoid having lots of local variables that may 
  conflict with those in the routine.

   Change name to R_SWIG_Callb....
*/
typedef struct RCallbackFunctionData {

  SEXP fun;
  SEXP userData;


  SEXP expr;
  SEXP retValue;
  int errorOccurred;

  SEXP el;  /* Temporary pointer used in the construction of the expression to call the R function. */

  struct RCallbackFunctionData *previous;   /* Stack */

} RCallbackFunctionData;

static RCallbackFunctionData  *callbackFunctionDataStack;


SWIGRUNTIME SEXP
R_SWIG_debug_getCallbackFunctionData(void)
{
  int n, i;
  SEXP ans;
  RCallbackFunctionData  *p = callbackFunctionDataStack;

  n = 0;
  while(p) { 
    n++;
    p = p->previous;
  }

  Rf_protect(ans = Rf_allocVector(VECSXP, n));
  for(p = callbackFunctionDataStack, i = 0; i < n; p = p->previous, i++) 
      SET_VECTOR_ELT(ans, i, p->fun);

  Rf_unprotect(1);

  return(ans);
}



SWIGRUNTIME RCallbackFunctionData *
R_SWIG_pushCallbackFunctionData(SEXP fun, SEXP userData)
{
   RCallbackFunctionData *el;
   el = (RCallbackFunctionData *) calloc(1, sizeof(RCallbackFunctionData));
   el->fun = fun;
   el->userData = userData;
   el->previous = callbackFunctionDataStack;

   callbackFunctionDataStack = el;

   return(el);
}


SWIGRUNTIME SEXP
R_SWIG_R_pushCallbackFunctionData(SEXP fun, SEXP userData)
{
    R_SWIG_pushCallbackFunctionData(fun, userData);
    return R_NilValue;
}

SWIGRUNTIME RCallbackFunctionData *
R_SWIG_getCallbackFunctionData(void)
{
  if(!callbackFunctionDataStack) {
    Rf_error("Supposedly impossible error occurred in the SWIG callback mechanism."
            "  No callback function data set.");
  }
  
  return callbackFunctionDataStack;
}

SWIGRUNTIME void
R_SWIG_popCallbackFunctionData(int doFree)
{
  RCallbackFunctionData  *el = NULL;
  if(!callbackFunctionDataStack)
    return ; /* Error !!! */

  el = callbackFunctionDataStack ;
  callbackFunctionDataStack = callbackFunctionDataStack->previous;

  if(doFree)
     free(el);
}


/*
  Interface to S function
      is(obj, type)
  which is to be used to determine if an 
  external pointer inherits from the right class.

  Ideally, we would like to be able to do this without an explicit call to the is() function.
  When the S4 class system uses its own SEXP types, then we will hopefully be able to do this
  in the C code.

  Should we make the expression static and preserve it to avoid the overhead of 
  allocating each time.
*/
SWIGRUNTIME int
R_SWIG_checkInherits(SEXP obj, SEXP tag, const char *type)
{
  SEXP e, val;
  int check_err = 0;

  Rf_protect(e = Rf_allocVector(LANGSXP, 3));
  SETCAR(e, Rf_install("extends"));

  SETCAR(CDR(e), Rf_mkString(CHAR(PRINTNAME(tag))));
  SETCAR(CDR(CDR(e)), Rf_mkString(type));

  val = R_tryEval(e, R_GlobalEnv, &check_err);
  Rf_unprotect(1);
  if(check_err) 
    return(0);


  return(LOGICAL(val)[0]);
}


SWIGRUNTIME void *
R_SWIG_resolveExternalRef(SEXP arg, const char * const type, const char * const argName, Rboolean nullOk)
{
  void *ptr;
  SEXP orig = arg;

  if(TYPEOF(arg) != EXTPTRSXP) 
    arg = GET_SLOT(arg, Rf_mkString("ref"));

  
  if(TYPEOF(arg) != EXTPTRSXP) {
    Rf_error("argument %s must be an external pointer (from an ExternalReference)", argName);
  }


  ptr = R_ExternalPtrAddr(arg);

  if(ptr == NULL && nullOk == (Rboolean) FALSE) {
    Rf_error("the external pointer (of type %s) for argument %s has value NULL", argName, type);
  }

  if(type[0] && R_ExternalPtrTag(arg) != Rf_install(type) && strcmp(type, "voidRef")
      && !R_SWIG_checkInherits(orig,  R_ExternalPtrTag(arg), type)) {
    Rf_error("the external pointer for argument %s has tag %s, not the expected value %s",
             argName, CHAR(PRINTNAME(R_ExternalPtrTag(arg))), type);
  }


  return(ptr);
}

SWIGRUNTIME void
R_SWIG_ReferenceFinalizer(SEXP el)
{
  void *ptr = R_SWIG_resolveExternalRef(el, "", "<finalizer>",  (Rboolean) 1);
  Rf_PrintValue(el);

  if(ptr) {
     if(TYPEOF(el) != EXTPTRSXP)
        el = GET_SLOT(el, Rf_mkString("ref"));

     if(TYPEOF(el) == EXTPTRSXP)
        R_ClearExternalPtr(el);

     free(ptr);
  }

  return;
}

typedef enum {R_SWIG_EXTERNAL, R_SWIG_OWNER } R_SWIG_Owner;

SWIGRUNTIME SEXP
SWIG_MakePtr(void *ptr, const char *typeName, R_SWIG_Owner owner)
{
  SEXP external, r_obj;

  Rf_protect(external = R_MakeExternalPtr(ptr, Rf_install(typeName), R_NilValue));
  Rf_protect(r_obj = NEW_OBJECT(MAKE_CLASS((char *) typeName)));

  if(owner)
    R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer);

  r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external);
  SET_S4_OBJECT(r_obj);
  Rf_unprotect(2);

  return(r_obj);
}


SWIGRUNTIME SEXP
R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len)
{
   SEXP arr;

/*XXX remove the char * cast when we can. MAKE_CLASS should be declared appropriately. */
   Rf_protect(arr = NEW_OBJECT(MAKE_CLASS((char *) typeName)));
   Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("ref"), ref));
   Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len)));

   Rf_unprotect(3); 			   
   SET_S4_OBJECT(arr);	
   return arr;
}

#define ADD_OUTPUT_ARG(result, pos, value, name)  r_ans = AddOutputArgToReturn(pos, value, name, OutputValues);

SWIGRUNTIME SEXP
AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output)
{
  SET_VECTOR_ELT(output, pos, value);

  return(output);
}

/* Create a new pointer object */
SWIGRUNTIMEINLINE SEXP
SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
  SEXP rptr = PROTECT(R_MakeExternalPtr(ptr, PROTECT(R_MakeExternalPtr(type, R_NilValue, R_NilValue)), R_NilValue)); 
  SET_S4_OBJECT(rptr);
  UNPROTECT(2);
  return rptr;
}


/* Convert a pointer value */
SWIGRUNTIMEINLINE int
SWIG_R_ConvertPtr(SEXP obj, void **ptr, swig_type_info *ty, int flags) {
  void *vptr;
  if (!obj) return SWIG_ERROR;
  if (obj == R_NilValue) {
    if (ptr) *ptr = NULL;
    return SWIG_OK;
  }

  vptr = R_ExternalPtrAddr(obj);
  if (ty) {
    swig_type_info *to = (swig_type_info*) 
      R_ExternalPtrAddr(R_ExternalPtrTag(obj));
    if (to == ty) {
      if (ptr) *ptr = vptr;
    } else {
      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
      int newmemory = 0;
      if (ptr) *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
      assert(!newmemory); /* newmemory handling not yet implemented */
    }
  } else {
      if (ptr) *ptr = vptr;
 }
  return SWIG_OK;
}

SWIGRUNTIME swig_module_info *
SWIG_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
  static void *type_pointer = (void *)0;
  return (swig_module_info *) type_pointer;
}

SWIGRUNTIME void
SWIG_SetModule(void *v, swig_module_info *swig_module) {
}

typedef struct {
  void *pack;
  swig_type_info *ty;
  size_t size;
} RSwigPacked;

/* Create a new packed object */

SWIGRUNTIMEINLINE SEXP RSwigPacked_New(void *ptr, size_t sz,
		  swig_type_info *ty) {
  SEXP rptr;
  RSwigPacked *sobj = 
  (RSwigPacked*) malloc(sizeof(RSwigPacked));
  if (sobj) {
    void *pack = malloc(sz);
    if (pack) {
      memcpy(pack, ptr, sz);
      sobj->pack = pack;
      sobj->ty   = ty;
      sobj->size = sz;
    } else {
      sobj = 0;
    }
  }
  rptr = R_MakeExternalPtr(sobj, R_NilValue, R_NilValue); 
  return rptr;
}

SWIGRUNTIME swig_type_info *
RSwigPacked_UnpackData(SEXP obj, void *ptr, size_t size)
{
    RSwigPacked *sobj = 
        (RSwigPacked *)R_ExternalPtrAddr(obj);
    if (sobj->size != size) return 0;
    memcpy(ptr, sobj->pack, size);
    return sobj->ty;
}

SWIGRUNTIMEINLINE SEXP
SWIG_R_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
  return ptr ? RSwigPacked_New((void *) ptr, sz, type) : R_NilValue;
}

/* Convert a packed value value */

SWIGRUNTIME int
SWIG_R_ConvertPacked(SEXP obj, void *ptr, size_t sz, swig_type_info *ty) {
  swig_type_info *to = RSwigPacked_UnpackData(obj, ptr, sz);
  if (!to) return SWIG_ERROR;
  if (ty) {
    if (to != ty) {
      /* check type cast? */
      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
      if (!tc) return SWIG_ERROR;
    }
  }
  return SWIG_OK;
}  

#ifdef __cplusplus
#define SWIG_exception_noreturn(code, msg) do { throw std::runtime_error(msg); } while(0)
#else
#define SWIG_exception_noreturn(code, msg) do { return result; } while(0)
#endif

#ifdef __cplusplus
}
#endif



#define SWIG_exception_fail(code, msg) do { Rf_warning(msg); return Rf_ScalarLogical(NA_LOGICAL); return Rf_ScalarLogical(NA_LOGICAL); } while(0) 

#define SWIG_contract_assert(expr, msg) if (!(expr)) { Rf_warning(msg); return Rf_ScalarLogical(NA_LOGICAL); return Rf_ScalarLogical(NA_LOGICAL); } else 



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

#define SWIGTYPE_p_char swig_types[0]
#define SWIGTYPE_p_librdf_digest_s swig_types[1]
#define SWIGTYPE_p_librdf_hash_s swig_types[2]
#define SWIGTYPE_p_librdf_iterator_s swig_types[3]
#define SWIGTYPE_p_librdf_log_func swig_types[4]
#define SWIGTYPE_p_librdf_log_message swig_types[5]
#define SWIGTYPE_p_librdf_model_s swig_types[6]
#define SWIGTYPE_p_librdf_node_s swig_types[7]
#define SWIGTYPE_p_librdf_parser_s swig_types[8]
#define SWIGTYPE_p_librdf_query swig_types[9]
#define SWIGTYPE_p_librdf_query_results swig_types[10]
#define SWIGTYPE_p_librdf_serializer_s swig_types[11]
#define SWIGTYPE_p_librdf_statement_s swig_types[12]
#define SWIGTYPE_p_librdf_storage_s swig_types[13]
#define SWIGTYPE_p_librdf_stream_s swig_types[14]
#define SWIGTYPE_p_librdf_uri_s swig_types[15]
#define SWIGTYPE_p_librdf_world_s swig_types[16]
#define SWIGTYPE_p_p_char swig_types[17]
#define SWIGTYPE_p_raptor_locator swig_types[18]
static swig_type_info *swig_types[20];
static swig_module_info swig_module = {swig_types, 19, 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) -------- */


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1
#define  SWIG_IOError        	   -2
#define  SWIG_RuntimeError   	   -3
#define  SWIG_IndexError     	   -4
#define  SWIG_TypeError      	   -5
#define  SWIG_DivisionByZero 	   -6
#define  SWIG_OverflowError  	   -7
#define  SWIG_SyntaxError    	   -8
#define  SWIG_ValueError     	   -9
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12
#define  SWIG_NullReferenceError   -13




#define SWIGVERSION 0x030012 
#define SWIG_VERSION SWIGVERSION


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



/* 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.");
}



SWIGINTERN char *
SWIG_strdup(const char *str)
{
  char *newstr = (char *)(malloc(strlen(str) + 1));
  return strcpy(newstr, str);
}


SWIGINTERN int
SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc)
{
  if (cptr && Rf_isString(obj)) {
    char *cstr = (char *)(CHAR(STRING_ELT(obj, 0)));
    int len = strlen(cstr);

    if (alloc) {
      if (*alloc == SWIG_NEWOBJ) {
        *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
        *alloc = SWIG_NEWOBJ;
      } else {
        *cptr = cstr;
      }
    } else {
      *cptr = (char *)(malloc(len + 1));
      *cptr = strcpy(*cptr, cstr);
    }
    if (psize) *psize = len + 1;
    return SWIG_OK;
  }
  return SWIG_TypeError;
}





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


SWIGINTERNINLINE  int
SWIG_AsVal_long (SEXP obj, long *val)
{
   if (val) *val = Rf_asInteger(obj);
   return SWIG_OK;
}


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


SWIGINTERN SEXP
SWIG_FromCharPtrAndSize(const char* carray, size_t size) 
{
  SEXP t, c;
  if (!carray) return R_NilValue;
/* See R internals document 1.10.  
   MkCharLen was introduced in 2.7.0.  Use that instead of hand
   creating vector.

   Starting in 2.8.0 creating strings via vectors was deprecated in
   order to allow for use of CHARSXP caches. */

  Rf_protect(t = Rf_allocVector(STRSXP, 1));
#if R_VERSION >=  R_Version(2,7,0)
  c = Rf_mkCharLen(carray, size);
#else
  c = Rf_allocVector(CHARSXP, size);
  strncpy((char *)CHAR(c), carray, size);
#endif
  SET_STRING_ELT(t, 0, c);
  Rf_unprotect(1);
  return t;
}


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


SWIGINTERNINLINE SEXP
SWIG_From_unsigned_SS_long  (unsigned long value)
{
	return Rf_ScalarInteger((int)value);
}


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


#ifdef __cplusplus
extern "C" {
#endif

SWIGEXPORT SEXP
R_swig_librdf_new_digest ( SEXP world, SEXP name)
{
  librdf_digest *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_digest" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  arg2 = (char *)(SWIG_strdup(CHAR(STRING_ELT(name, 0))));
  result = (librdf_digest *)librdf_new_digest(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_digest_s, R_SWIG_OWNER |  0 );
  
  free(arg2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_digest ( SEXP digest)
{
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_digest" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  librdf_free_digest(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_digest_init ( SEXP digest)
{
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_digest_init" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  librdf_digest_init(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_digest_update ( SEXP digest, SEXP buf, SEXP length)
{
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_digest_update" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(buf, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_digest_update" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(length, &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "librdf_digest_update" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  librdf_digest_update(arg1,(unsigned char const *)arg2,arg3);
  r_ans = R_NilValue;
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_digest_update_string ( SEXP digest, SEXP string)
{
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_digest_update_string" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_digest_update_string" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  librdf_digest_update_string(arg1,(unsigned char const *)arg2);
  r_ans = R_NilValue;
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_digest_final ( SEXP digest)
{
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_digest_final" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  librdf_digest_final(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_digest_to_string ( SEXP digest)
{
  char *result = 0 ;
  librdf_digest *arg1 = (librdf_digest *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(digest, &argp1, SWIGTYPE_p_librdf_digest_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_digest_to_string" "', argument " "1"" of type '" "librdf_digest *""'"); 
  }
  arg1 = (librdf_digest *)(argp1);
  result = (char *)librdf_digest_to_string(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_hash ( SEXP world, SEXP name)
{
  librdf_hash *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_hash" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_hash" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (librdf_hash *)librdf_new_hash(arg1,(char const *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_hash_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_hash_from_string ( SEXP world, SEXP name, SEXP string)
{
  librdf_hash *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_hash_from_string" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_hash_from_string" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(string, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_hash_from_string" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  result = (librdf_hash *)librdf_new_hash_from_string(arg1,(char const *)arg2,(char const *)arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_hash_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_hash_from_array_of_strings ( SEXP world, SEXP name, SEXP string)
{
  librdf_hash *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char **arg3 = (char **) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_hash_from_array_of_strings" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_hash_from_array_of_strings" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(string, &argp3, SWIGTYPE_p_p_char, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_hash_from_array_of_strings" "', argument " "3"" of type '" "char const **""'"); 
  }
  arg3 = (char **)(argp3);
  result = (librdf_hash *)librdf_new_hash_from_array_of_strings(arg1,(char const *)arg2,(char const **)arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_hash_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_hash_to_string ( SEXP hash, SEXP filter)
{
  char *result = 0 ;
  librdf_hash *arg1 = (librdf_hash *) 0 ;
  char **arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(hash, &argp1, SWIGTYPE_p_librdf_hash_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_hash_to_string" "', argument " "1"" of type '" "librdf_hash *""'"); 
  }
  arg1 = (librdf_hash *)(argp1);
  arg2 = (char **)(SWIG_strdup(CHAR(STRING_ELT(filter, 0))));
  result = (char *)librdf_hash_to_string(arg1,(char const *(*))arg2);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  free(arg2);
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_hash ( SEXP hash)
{
  librdf_hash *arg1 = (librdf_hash *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(hash, &argp1, SWIGTYPE_p_librdf_hash_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_hash" "', argument " "1"" of type '" "librdf_hash *""'"); 
  }
  arg1 = (librdf_hash *)(argp1);
  librdf_free_hash(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_world ( void)
{
  librdf_world *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (librdf_world *)librdf_new_world();
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_world_s, R_SWIG_OWNER |  0 );
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_world ( SEXP world)
{
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_world" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  librdf_free_world(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_world_open ( SEXP world)
{
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_world_open" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  librdf_world_open(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_world_get_feature ( SEXP world, SEXP feature)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_world_get_feature" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_world_get_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (librdf_node *)librdf_world_get_feature(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_world_set_feature ( SEXP world, SEXP feature, SEXP value, SEXP s_swig_copy)
{
  int result;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_world_set_feature" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_world_set_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(value, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_world_set_feature" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_world_set_feature(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_get_accept_header ( SEXP parser)
{
  char *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_get_accept_header" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  result = (char *)librdf_parser_get_accept_header(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_world_set_logger ( SEXP world, SEXP user_data, SEXP log_handler)
{
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *arg2 = (void *) 0 ;
  librdf_log_func arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  void *argp3 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_world_set_logger" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(user_data, SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_world_set_logger" "', argument " "2"" of type '" "void *""'"); 
  }
  {
    res3 = SWIG_R_ConvertPtr(log_handler, &argp3, SWIGTYPE_p_librdf_log_func,  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_world_set_logger" "', argument " "3"" of type '" "librdf_log_func""'"); 
    }  
    if (!argp3) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "librdf_world_set_logger" "', argument " "3"" of type '" "librdf_log_func""'");
    } else {
      arg3 = *((librdf_log_func *)(argp3));
    }
  }
  librdf_world_set_logger(arg1,arg2,arg3);
  r_ans = R_NilValue;
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_iterator ( SEXP s_arg1)
{
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(s_arg1, &argp1, SWIGTYPE_p_librdf_iterator_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_iterator" "', argument " "1"" of type '" "librdf_iterator *""'"); 
  }
  arg1 = (librdf_iterator *)(argp1);
  librdf_free_iterator(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_iterator_end ( SEXP iterator, SEXP s_swig_copy)
{
  int result;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(iterator, &argp1, SWIGTYPE_p_librdf_iterator_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_iterator_end" "', argument " "1"" of type '" "librdf_iterator *""'"); 
  }
  arg1 = (librdf_iterator *)(argp1);
  result = (int)librdf_iterator_end(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_iterator_get_object ( SEXP iterator)
{
  librdf_node *result = 0 ;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(iterator, &argp1, SWIGTYPE_p_librdf_iterator_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_iterator_get_object" "', argument " "1"" of type '" "librdf_iterator *""'"); 
  }
  arg1 = (librdf_iterator *)(argp1);
  result = (librdf_node *)librdf_iterator_get_object(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_iterator_get_context ( SEXP iterator)
{
  librdf_node *result = 0 ;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(iterator, &argp1, SWIGTYPE_p_librdf_iterator_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_iterator_get_context" "', argument " "1"" of type '" "librdf_iterator *""'"); 
  }
  arg1 = (librdf_iterator *)(argp1);
  result = (librdf_node *)librdf_iterator_get_context(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_iterator_next ( SEXP iterator, SEXP s_swig_copy)
{
  int result;
  librdf_iterator *arg1 = (librdf_iterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(iterator, &argp1, SWIGTYPE_p_librdf_iterator_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_iterator_next" "', argument " "1"" of type '" "librdf_iterator *""'"); 
  }
  arg1 = (librdf_iterator *)(argp1);
  result = (int)librdf_iterator_next(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_uri ( SEXP world, SEXP string)
{
  librdf_uri *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_uri" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  arg2 = (char *)(SWIG_strdup(CHAR(STRING_ELT(string, 0))));
  result = (librdf_uri *)librdf_new_uri(arg1,(unsigned char *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_OWNER |  0 );
  
  free(arg2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_uri_from_uri ( SEXP uri)
{
  librdf_uri *result = 0 ;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(uri, &argp1, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_uri_from_uri" "', argument " "1"" of type '" "librdf_uri *""'"); 
  }
  arg1 = (librdf_uri *)(argp1);
  result = (librdf_uri *)librdf_new_uri_from_uri(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_uri_from_filename ( SEXP world, SEXP filename)
{
  librdf_uri *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_uri_from_filename" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(filename, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_uri_from_filename" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (librdf_uri *)librdf_new_uri_from_filename(arg1,(char const *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_EXTERNAL |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_uri ( SEXP uri)
{
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(uri, &argp1, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_uri" "', argument " "1"" of type '" "librdf_uri *""'"); 
  }
  arg1 = (librdf_uri *)(argp1);
  librdf_free_uri(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_uri_to_string ( SEXP uri)
{
  char *result = 0 ;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(uri, &argp1, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_uri_to_string" "', argument " "1"" of type '" "librdf_uri *""'"); 
  }
  arg1 = (librdf_uri *)(argp1);
  result = (char *)librdf_uri_to_string(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_uri_equals ( SEXP first_uri, SEXP second_uri, SEXP s_swig_copy)
{
  int result;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(first_uri, &argp1, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_uri_equals" "', argument " "1"" of type '" "librdf_uri *""'"); 
  }
  arg1 = (librdf_uri *)(argp1);
  res2 = SWIG_R_ConvertPtr(second_uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_uri_equals" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (int)librdf_uri_equals(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_uri_compare ( SEXP first_uri, SEXP second_uri, SEXP s_swig_copy)
{
  int result;
  librdf_uri *arg1 = (librdf_uri *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(first_uri, &argp1, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_uri_compare" "', argument " "1"" of type '" "librdf_uri *""'"); 
  }
  arg1 = (librdf_uri *)(argp1);
  res2 = SWIG_R_ConvertPtr(second_uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_uri_compare" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (int)librdf_uri_compare(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node ( SEXP world)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  result = (librdf_node *)librdf_new_node(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_uri_string ( SEXP world, SEXP string)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_uri_string" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_uri_string" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (librdf_node *)librdf_new_node_from_uri_string(arg1,(unsigned char const *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_uri ( SEXP world, SEXP uri)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_uri" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_uri" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (librdf_node *)librdf_new_node_from_uri(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_uri_local_name ( SEXP world, SEXP uri, SEXP local_name)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_uri_local_name" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_uri_local_name" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_AsCharPtrAndSize(local_name, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_node_from_uri_local_name" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  result = (librdf_node *)librdf_new_node_from_uri_local_name(arg1,arg2,(unsigned char const *)arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_normalised_uri_string ( SEXP world, SEXP uri_string, SEXP source_uri, SEXP base_uri)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_normalised_uri_string" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(uri_string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_normalised_uri_string" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(source_uri, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_node_from_normalised_uri_string" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_R_ConvertPtr(base_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_node_from_normalised_uri_string" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  result = (librdf_node *)librdf_new_node_from_normalised_uri_string(arg1,(unsigned char const *)arg2,arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_literal ( SEXP world, SEXP string, SEXP inStrOrNull, SEXP is_wf_xml)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) NULL ;
  int arg4 = (int) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_literal" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_literal" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(inStrOrNull, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_node_from_literal" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  arg4 = (int)(INTEGER(is_wf_xml)[0]);
  result = (librdf_node *)librdf_new_node_from_literal(arg1,(unsigned char const *)arg2,(char const *)arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_typed_literal ( SEXP world, SEXP string, SEXP inStrOrNull, SEXP inUriOrNull)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) NULL ;
  librdf_uri *arg4 = (librdf_uri *) NULL ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_typed_literal" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_typed_literal" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(inStrOrNull, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_node_from_typed_literal" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_R_ConvertPtr(inUriOrNull, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_node_from_typed_literal" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  result = (librdf_node *)librdf_new_node_from_typed_literal(arg1,(unsigned char const *)arg2,(char const *)arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_node ( SEXP node)
{
  librdf_node *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_node" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (librdf_node *)librdf_new_node_from_node(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_node_from_blank_identifier ( SEXP world, SEXP inStrOrNull)
{
  librdf_node *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) NULL ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_node_from_blank_identifier" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(inStrOrNull, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_node_from_blank_identifier" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (librdf_node *)librdf_new_node_from_blank_identifier(arg1,(unsigned char const *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_node ( SEXP r)
{
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(r, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_node" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  librdf_free_node(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_uri ( SEXP node)
{
  librdf_uri *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_uri" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (librdf_uri *)librdf_node_get_uri(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_type ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_type" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_get_type(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_literal_value ( SEXP node)
{
  char *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_literal_value" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (char *)librdf_node_get_literal_value(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_literal_value_as_latin1 ( SEXP node)
{
  char *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_literal_value_as_latin1" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (char *)librdf_node_get_literal_value_as_latin1(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_literal_value_language ( SEXP node)
{
  char *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_literal_value_language" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (char *)librdf_node_get_literal_value_language(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_literal_value_datatype_uri ( SEXP node)
{
  librdf_uri *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_literal_value_datatype_uri" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (librdf_uri *)librdf_node_get_literal_value_datatype_uri(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_literal_value_is_wf_xml ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_literal_value_is_wf_xml" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_get_literal_value_is_wf_xml(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_li_ordinal ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_li_ordinal" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_get_li_ordinal(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_get_blank_identifier ( SEXP node)
{
  char *result = 0 ;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_get_blank_identifier" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (char *)librdf_node_get_blank_identifier(arg1);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_is_resource ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_is_resource" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_is_resource(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_is_literal ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_is_literal" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_is_literal(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_is_blank ( SEXP node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_is_blank" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  result = (int)librdf_node_is_blank(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_node_equals ( SEXP first_node, SEXP second_node, SEXP s_swig_copy)
{
  int result;
  librdf_node *arg1 = (librdf_node *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(first_node, &argp1, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_node_equals" "', argument " "1"" of type '" "librdf_node *""'"); 
  }
  arg1 = (librdf_node *)(argp1);
  res2 = SWIG_R_ConvertPtr(second_node, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_node_equals" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (int)librdf_node_equals(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_statement ( SEXP world)
{
  librdf_statement *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_statement" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  result = (librdf_statement *)librdf_new_statement(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_statement_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_statement_from_statement ( SEXP statement)
{
  librdf_statement *result = 0 ;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_statement_from_statement" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  result = (librdf_statement *)librdf_new_statement_from_statement(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_statement_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_statement_from_nodes ( SEXP world, SEXP subject, SEXP predicate, SEXP object)
{
  librdf_statement *result = 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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_statement_from_nodes" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(subject, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_statement_from_nodes" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(predicate, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_statement_from_nodes" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  res4 = SWIG_R_ConvertPtr(object, &argp4, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_statement_from_nodes" "', argument " "4"" of type '" "librdf_node *""'"); 
  }
  arg4 = (librdf_node *)(argp4);
  result = (librdf_statement *)librdf_new_statement_from_nodes(arg1,arg2,arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_statement_s, R_SWIG_OWNER |  0 );
  
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_statement ( SEXP statement)
{
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_statement" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  librdf_free_statement(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_get_subject ( SEXP statement)
{
  librdf_node *result = 0 ;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_get_subject" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  result = (librdf_node *)librdf_statement_get_subject(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_set_subject ( SEXP statement, SEXP subject)
{
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_set_subject" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  res2 = SWIG_R_ConvertPtr(subject, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_statement_set_subject" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  librdf_statement_set_subject(arg1,arg2);
  r_ans = R_NilValue;
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_get_predicate ( SEXP statement)
{
  librdf_node *result = 0 ;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_get_predicate" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  result = (librdf_node *)librdf_statement_get_predicate(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_set_predicate ( SEXP statement, SEXP predicate)
{
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_set_predicate" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  res2 = SWIG_R_ConvertPtr(predicate, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_statement_set_predicate" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  librdf_statement_set_predicate(arg1,arg2);
  r_ans = R_NilValue;
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_get_object ( SEXP statement)
{
  librdf_node *result = 0 ;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_get_object" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  result = (librdf_node *)librdf_statement_get_object(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_set_object ( SEXP statement, SEXP object)
{
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_set_object" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  res2 = SWIG_R_ConvertPtr(object, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_statement_set_object" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  librdf_statement_set_object(arg1,arg2);
  r_ans = R_NilValue;
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_equals ( SEXP statement1, SEXP statement2, SEXP s_swig_copy)
{
  int result;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement1, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_equals" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement2, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_statement_equals" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (int)librdf_statement_equals(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_match ( SEXP statement, SEXP partial_statement, SEXP s_swig_copy)
{
  int result;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_match" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  res2 = SWIG_R_ConvertPtr(partial_statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_statement_match" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (int)librdf_statement_match(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_statement_is_complete ( SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_statement *arg1 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(statement, &argp1, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_statement_is_complete" "', argument " "1"" of type '" "librdf_statement *""'"); 
  }
  arg1 = (librdf_statement *)(argp1);
  result = (int)librdf_statement_is_complete(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_model ( SEXP world, SEXP storage, SEXP options_string)
{
  librdf_model *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_storage *arg2 = (librdf_storage *) 0 ;
  char *arg3 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_model" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(storage, &argp2, SWIGTYPE_p_librdf_storage_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_model" "', argument " "2"" of type '" "librdf_storage *""'"); 
  }
  arg2 = (librdf_storage *)(argp2);
  arg3 = (char *)(SWIG_strdup(CHAR(STRING_ELT(options_string, 0))));
  result = (librdf_model *)librdf_new_model(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_model_s, R_SWIG_OWNER |  0 );
  
  
  free(arg3);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_model_with_options ( SEXP world, SEXP storage, SEXP options)
{
  librdf_model *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  librdf_storage *arg2 = (librdf_storage *) 0 ;
  librdf_hash *arg3 = (librdf_hash *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_model_with_options" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_R_ConvertPtr(storage, &argp2, SWIGTYPE_p_librdf_storage_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_model_with_options" "', argument " "2"" of type '" "librdf_storage *""'"); 
  }
  arg2 = (librdf_storage *)(argp2);
  res3 = SWIG_R_ConvertPtr(options, &argp3, SWIGTYPE_p_librdf_hash_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_model_with_options" "', argument " "3"" of type '" "librdf_hash *""'"); 
  }
  arg3 = (librdf_hash *)(argp3);
  result = (librdf_model *)librdf_new_model_with_options(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_model_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_model_from_model ( SEXP model)
{
  librdf_model *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_model_from_model" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (librdf_model *)librdf_new_model_from_model(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_model_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_model ( SEXP model)
{
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_model" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  librdf_free_model(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_size ( SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_size" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (int)librdf_model_size(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_add ( SEXP model, SEXP subject, SEXP predicate, SEXP object, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  librdf_node *arg4 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_add" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(subject, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_add" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(predicate, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_add" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  res4 = SWIG_R_ConvertPtr(object, &argp4, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_model_add" "', argument " "4"" of type '" "librdf_node *""'"); 
  }
  arg4 = (librdf_node *)(argp4);
  result = (int)librdf_model_add(arg1,arg2,arg3,arg4);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_add_string_literal_statement ( SEXP model, SEXP subject, SEXP predicate, SEXP literal, SEXP inStrOrNull, SEXP is_wf_xml, SEXP s_swig_copy)
{
  int result;
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  int res5 ;
  char *buf5 = 0 ;
  int alloc5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_add_string_literal_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(subject, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_add_string_literal_statement" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(predicate, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_add_string_literal_statement" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  res4 = SWIG_AsCharPtrAndSize(literal, &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_model_add_string_literal_statement" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = (char *)(buf4);
  res5 = SWIG_AsCharPtrAndSize(inStrOrNull, &buf5, NULL, &alloc5);
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_model_add_string_literal_statement" "', argument " "5"" of type '" "char const *""'");
  }
  arg5 = (char *)(buf5);
  arg6 = (int)(INTEGER(is_wf_xml)[0]);
  result = (int)librdf_model_add_string_literal_statement(arg1,arg2,arg3,(unsigned char const *)arg4,(char const *)arg5,arg6);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_add_typed_literal_statement ( SEXP model, SEXP subject, SEXP predicate, SEXP string, SEXP inStrOrNull, SEXP inUriOrNull, SEXP s_swig_copy)
{
  int result;
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp6 = 0 ;
  int res6 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_add_typed_literal_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(subject, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_add_typed_literal_statement" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(predicate, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_add_typed_literal_statement" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  arg4 = (char *)(SWIG_strdup(CHAR(STRING_ELT(string, 0))));
  arg5 = (char *)(SWIG_strdup(CHAR(STRING_ELT(inStrOrNull, 0))));
  res6 = SWIG_R_ConvertPtr(inUriOrNull, &argp6, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "librdf_model_add_typed_literal_statement" "', argument " "6"" of type '" "librdf_uri *""'"); 
  }
  arg6 = (librdf_uri *)(argp6);
  result = (int)librdf_model_add_typed_literal_statement(arg1,arg2,arg3,(unsigned char *)arg4,arg5,arg6);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  free(arg4);
  free(arg5);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_add_statement ( SEXP model, SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_add_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_add_statement" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (int)librdf_model_add_statement(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_add_statements ( SEXP model, SEXP statement_stream, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_stream *arg2 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_add_statements" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement_stream, &argp2, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_add_statements" "', argument " "2"" of type '" "librdf_stream *""'"); 
  }
  arg2 = (librdf_stream *)(argp2);
  result = (int)librdf_model_add_statements(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_remove_statement ( SEXP model, SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_remove_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_remove_statement" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (int)librdf_model_remove_statement(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_contains_statement ( SEXP model, SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_contains_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_contains_statement" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (int)librdf_model_contains_statement(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_as_stream ( SEXP model)
{
  librdf_stream *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_as_stream" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (librdf_stream *)librdf_model_as_stream(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_find_statements ( SEXP model, SEXP statement)
{
  librdf_stream *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_find_statements" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_find_statements" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  result = (librdf_stream *)librdf_model_find_statements(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_find_statements_in_context ( SEXP model, SEXP statement, SEXP inNodeOrNull)
{
  librdf_stream *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_statement *arg2 = (librdf_statement *) 0 ;
  librdf_node *arg3 = (librdf_node *) NULL ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_find_statements_in_context" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(statement, &argp2, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_find_statements_in_context" "', argument " "2"" of type '" "librdf_statement *""'"); 
  }
  arg2 = (librdf_statement *)(argp2);
  res3 = SWIG_R_ConvertPtr(inNodeOrNull, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_find_statements_in_context" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_stream *)librdf_model_find_statements_in_context(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_sources ( SEXP model, SEXP arc, SEXP target)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_sources" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(arc, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_sources" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(target, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_sources" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_iterator *)librdf_model_get_sources(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_arcs ( SEXP model, SEXP source, SEXP target)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_arcs" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(source, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_arcs" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(target, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_arcs" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_iterator *)librdf_model_get_arcs(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_targets ( SEXP model, SEXP source, SEXP arc)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_targets" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(source, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_targets" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(arc, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_targets" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_iterator *)librdf_model_get_targets(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_source ( SEXP model, SEXP arc, SEXP target)
{
  librdf_node *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_source" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(arc, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_source" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(target, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_source" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_node *)librdf_model_get_source(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_arc ( SEXP model, SEXP source, SEXP target)
{
  librdf_node *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_arc" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(source, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_arc" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(target, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_arc" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_node *)librdf_model_get_arc(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_arcs_out ( SEXP model, SEXP node)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_arcs_out" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(node, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_arcs_out" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (librdf_iterator *)librdf_model_get_arcs_out(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_arcs_in ( SEXP model, SEXP node)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_arcs_in" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(node, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_arcs_in" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (librdf_iterator *)librdf_model_get_arcs_in(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_has_arc_in ( SEXP model, SEXP node, SEXP property, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_has_arc_in" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(node, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_has_arc_in" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(property, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_has_arc_in" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_model_has_arc_in(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_has_arc_out ( SEXP model, SEXP node, SEXP property, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_has_arc_out" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(node, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_has_arc_out" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(property, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_has_arc_out" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_model_has_arc_out(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_target ( SEXP model, SEXP source, SEXP arc)
{
  librdf_node *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_target" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(source, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_target" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(arc, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_get_target" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (librdf_node *)librdf_model_get_target(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_context_add_statement ( SEXP model, SEXP context, SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_statement *arg3 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_context_add_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_context_add_statement" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(statement, &argp3, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_context_add_statement" "', argument " "3"" of type '" "librdf_statement *""'"); 
  }
  arg3 = (librdf_statement *)(argp3);
  result = (int)librdf_model_context_add_statement(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_context_add_statements ( SEXP model, SEXP context, SEXP stream, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_stream *arg3 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_context_add_statements" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_context_add_statements" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(stream, &argp3, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_context_add_statements" "', argument " "3"" of type '" "librdf_stream *""'"); 
  }
  arg3 = (librdf_stream *)(argp3);
  result = (int)librdf_model_context_add_statements(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_context_remove_statement ( SEXP model, SEXP context, SEXP statement, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  librdf_statement *arg3 = (librdf_statement *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_context_remove_statement" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_context_remove_statement" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  res3 = SWIG_R_ConvertPtr(statement, &argp3, SWIGTYPE_p_librdf_statement_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_context_remove_statement" "', argument " "3"" of type '" "librdf_statement *""'"); 
  }
  arg3 = (librdf_statement *)(argp3);
  result = (int)librdf_model_context_remove_statement(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_context_remove_statements ( SEXP model, SEXP context, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_context_remove_statements" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_context_remove_statements" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (int)librdf_model_context_remove_statements(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_context_as_stream ( SEXP model, SEXP context)
{
  librdf_stream *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_context_as_stream" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_context_as_stream" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (librdf_stream *)librdf_model_context_as_stream(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_sync ( SEXP model)
{
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_sync" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  librdf_model_sync(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_contexts ( SEXP model)
{
  librdf_iterator *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_contexts" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (librdf_iterator *)librdf_model_get_contexts(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_iterator_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_contains_context ( SEXP model, SEXP context, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_node *arg2 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_contains_context" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(context, &argp2, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_contains_context" "', argument " "2"" of type '" "librdf_node *""'"); 
  }
  arg2 = (librdf_node *)(argp2);
  result = (int)librdf_model_contains_context(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_get_feature ( SEXP model, SEXP feature)
{
  librdf_node *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_get_feature" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_get_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (librdf_node *)librdf_model_get_feature(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_set_feature ( SEXP model, SEXP feature, SEXP value, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_set_feature" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_set_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(value, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_set_feature" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_model_set_feature(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_load ( SEXP model, SEXP uri, SEXP name, SEXP mime_type, SEXP type_uri, SEXP s_swig_copy)
{
  int result;
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_load" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_load" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_AsCharPtrAndSize(name, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_load" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_AsCharPtrAndSize(mime_type, &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_model_load" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = (char *)(buf4);
  res5 = SWIG_R_ConvertPtr(type_uri, &argp5, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_model_load" "', argument " "5"" of type '" "librdf_uri *""'"); 
  }
  arg5 = (librdf_uri *)(argp5);
  result = (int)librdf_model_load(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5);
  r_ans = Rf_ScalarInteger(result);
  
  
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_query_execute ( SEXP model, SEXP query)
{
  librdf_query_results *result = 0 ;
  librdf_model *arg1 = (librdf_model *) 0 ;
  librdf_query *arg2 = (librdf_query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_query_execute" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(query, &argp2, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_query_execute" "', argument " "2"" of type '" "librdf_query *""'"); 
  }
  arg2 = (librdf_query *)(argp2);
  result = (librdf_query_results *)librdf_model_query_execute(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_query_results, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_to_string ( SEXP model, SEXP uri, SEXP name, SEXP mime_type, SEXP inUriOrNull)
{
  char *result = 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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_to_string" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_model_to_string" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_AsCharPtrAndSize(name, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_model_to_string" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_AsCharPtrAndSize(mime_type, &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_model_to_string" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = (char *)(buf4);
  res5 = SWIG_R_ConvertPtr(inUriOrNull, &argp5, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_model_to_string" "', argument " "5"" of type '" "librdf_uri *""'"); 
  }
  arg5 = (librdf_uri *)(argp5);
  result = (char *)librdf_model_to_string(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_transaction_start ( SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_transaction_start" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (int)librdf_model_transaction_start(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_transaction_commit ( SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_transaction_commit" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (int)librdf_model_transaction_commit(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_model_transaction_rollback ( SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_model *arg1 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(model, &argp1, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_model_transaction_rollback" "', argument " "1"" of type '" "librdf_model *""'"); 
  }
  arg1 = (librdf_model *)(argp1);
  result = (int)librdf_model_transaction_rollback(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_storage ( SEXP world, SEXP storage_name, SEXP name, SEXP options_string)
{
  librdf_storage *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_storage" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  arg2 = (char *)(SWIG_strdup(CHAR(STRING_ELT(storage_name, 0))));
  arg3 = (char *)(SWIG_strdup(CHAR(STRING_ELT(name, 0))));
  arg4 = (char *)(SWIG_strdup(CHAR(STRING_ELT(options_string, 0))));
  result = (librdf_storage *)librdf_new_storage(arg1,arg2,arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_storage_s, R_SWIG_OWNER |  0 );
  
  free(arg2);
  free(arg3);
  free(arg4);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_storage_from_storage ( SEXP old_storage)
{
  librdf_storage *result = 0 ;
  librdf_storage *arg1 = (librdf_storage *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(old_storage, &argp1, SWIGTYPE_p_librdf_storage_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_storage_from_storage" "', argument " "1"" of type '" "librdf_storage *""'"); 
  }
  arg1 = (librdf_storage *)(argp1);
  result = (librdf_storage *)librdf_new_storage_from_storage(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_storage_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_storage ( SEXP storage)
{
  librdf_storage *arg1 = (librdf_storage *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(storage, &argp1, SWIGTYPE_p_librdf_storage_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_storage" "', argument " "1"" of type '" "librdf_storage *""'"); 
  }
  arg1 = (librdf_storage *)(argp1);
  librdf_free_storage(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_check_name ( SEXP world, SEXP name, SEXP s_swig_copy)
{
  int result;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_check_name" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_check_name" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (int)librdf_parser_check_name(arg1,(char const *)arg2);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_parser ( SEXP world, SEXP name, SEXP mime_type, SEXP type_uri)
{
  librdf_parser *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_parser" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_parser" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(mime_type, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_parser" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_R_ConvertPtr(type_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_parser" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  result = (librdf_parser *)librdf_new_parser(arg1,(char const *)arg2,(char const *)arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_parser_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_parser ( SEXP parser)
{
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_parser" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  librdf_free_parser(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_as_stream ( SEXP parser, SEXP uri, SEXP inUriorNull)
{
  librdf_stream *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) NULL ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_as_stream" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_as_stream" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(inUriorNull, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_parse_as_stream" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  result = (librdf_stream *)librdf_parser_parse_as_stream(arg1,arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_into_model ( SEXP parser, SEXP uri, SEXP inUriOrNull, SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_into_model" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_R_ConvertPtr(uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_into_model" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(inUriOrNull, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_parse_into_model" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_R_ConvertPtr(model, &argp4, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_parser_parse_into_model" "', argument " "4"" of type '" "librdf_model *""'"); 
  }
  arg4 = (librdf_model *)(argp4);
  result = (int)librdf_parser_parse_into_model(arg1,arg2,arg3,arg4);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_string_as_stream ( SEXP parser, SEXP string, SEXP base_uri)
{
  librdf_stream *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_string_as_stream" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_string_as_stream" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(base_uri, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_parse_string_as_stream" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  result = (librdf_stream *)librdf_parser_parse_string_as_stream(arg1,(unsigned char const *)arg2,arg3);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_string_into_model ( SEXP parser, SEXP string, SEXP base_uri, SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_string_into_model" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_string_into_model" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(base_uri, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_parse_string_into_model" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_R_ConvertPtr(model, &argp4, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_parser_parse_string_into_model" "', argument " "4"" of type '" "librdf_model *""'"); 
  }
  arg4 = (librdf_model *)(argp4);
  result = (int)librdf_parser_parse_string_into_model(arg1,(unsigned char const *)arg2,arg3,arg4);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_counted_string_as_stream ( SEXP parser, SEXP string, SEXP length, SEXP base_uri)
{
  librdf_stream *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_counted_string_as_stream" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_counted_string_as_stream" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(length, &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "librdf_parser_parse_counted_string_as_stream" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  res4 = SWIG_R_ConvertPtr(base_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_parser_parse_counted_string_as_stream" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  result = (librdf_stream *)librdf_parser_parse_counted_string_as_stream(arg1,(unsigned char const *)arg2,arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_EXTERNAL |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_parse_counted_string_into_model ( SEXP parser, SEXP string, SEXP length, SEXP base_uri, SEXP model, SEXP s_swig_copy)
{
  int result;
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_parse_counted_string_into_model" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(string, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_parse_counted_string_into_model" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_int(length, &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "librdf_parser_parse_counted_string_into_model" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  res4 = SWIG_R_ConvertPtr(base_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_parser_parse_counted_string_into_model" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  res5 = SWIG_R_ConvertPtr(model, &argp5, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_parser_parse_counted_string_into_model" "', argument " "5"" of type '" "librdf_model *""'"); 
  }
  arg5 = (librdf_model *)(argp5);
  result = (int)librdf_parser_parse_counted_string_into_model(arg1,(unsigned char const *)arg2,arg3,arg4,arg5);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_get_feature ( SEXP parser, SEXP feature)
{
  librdf_node *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_get_feature" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_get_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (librdf_node *)librdf_parser_get_feature(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_set_feature ( SEXP parser, SEXP feature, SEXP value, SEXP s_swig_copy)
{
  int result;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_set_feature" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_set_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(value, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_set_feature" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_parser_set_feature(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}

SWIGEXPORT SEXP
R_swig_librdf_parser_guess_name2 ( SEXP world, SEXP mime_type, SEXP buffer, SEXP identifier)
{
  char *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_guess_name2" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(mime_type, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_parser_guess_name2" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(buffer, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_parser_guess_name2" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_AsCharPtrAndSize(identifier, &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_parser_guess_name2" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = (char *)(buf4);
  result = (char *)librdf_parser_guess_name2(arg1,(char const *)arg2,(unsigned char const *)arg3,(unsigned char const *)arg4);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_get_namespaces_seen_prefix ( SEXP parser, SEXP offset)
{
  char *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_get_namespaces_seen_prefix" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  arg2 = (int)(INTEGER(offset)[0]);
  result = (char *)librdf_parser_get_namespaces_seen_prefix(arg1,arg2);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_get_namespaces_seen_uri ( SEXP parser, SEXP offset)
{
  librdf_uri *result = 0 ;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_get_namespaces_seen_uri" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  arg2 = (int)(INTEGER(offset)[0]);
  result = (librdf_uri *)librdf_parser_get_namespaces_seen_uri(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_uri_s, R_SWIG_EXTERNAL |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_parser_get_namespaces_seen_count ( SEXP parser, SEXP s_swig_copy)
{
  int result;
  librdf_parser *arg1 = (librdf_parser *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(parser, &argp1, SWIGTYPE_p_librdf_parser_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_parser_get_namespaces_seen_count" "', argument " "1"" of type '" "librdf_parser *""'"); 
  }
  arg1 = (librdf_parser *)(argp1);
  result = (int)librdf_parser_get_namespaces_seen_count(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_query ( SEXP world, SEXP name, SEXP uri, SEXP query_string, SEXP base_uri)
{
  librdf_query *result = 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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_query" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_query" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(uri, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_query" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_AsCharPtrAndSize(query_string, &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_query" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = (char *)(buf4);
  res5 = SWIG_R_ConvertPtr(base_uri, &argp5, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_new_query" "', argument " "5"" of type '" "librdf_uri *""'"); 
  }
  arg5 = (librdf_uri *)(argp5);
  result = (librdf_query *)librdf_new_query(arg1,(char const *)arg2,arg3,(unsigned char const *)arg4,arg5);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_query, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_query_from_query ( SEXP old_query)
{
  librdf_query *result = 0 ;
  librdf_query *arg1 = (librdf_query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(old_query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_query_from_query" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  result = (librdf_query *)librdf_new_query_from_query(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_query, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_query ( SEXP query)
{
  librdf_query *arg1 = (librdf_query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_query" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  librdf_free_query(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_execute ( SEXP query, SEXP model)
{
  librdf_query_results *result = 0 ;
  librdf_query *arg1 = (librdf_query *) 0 ;
  librdf_model *arg2 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_execute" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  res2 = SWIG_R_ConvertPtr(model, &argp2, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_query_execute" "', argument " "2"" of type '" "librdf_model *""'"); 
  }
  arg2 = (librdf_model *)(argp2);
  result = (librdf_query_results *)librdf_query_execute(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_query_results, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_get_limit ( SEXP query, SEXP s_swig_copy)
{
  int result;
  librdf_query *arg1 = (librdf_query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_get_limit" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  result = (int)librdf_query_get_limit(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_set_limit ( SEXP query, SEXP limit, SEXP s_swig_copy)
{
  int result;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_set_limit" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  arg2 = (int)(INTEGER(limit)[0]);
  result = (int)librdf_query_set_limit(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_get_offset ( SEXP query, SEXP s_swig_copy)
{
  int result;
  librdf_query *arg1 = (librdf_query *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_get_offset" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  result = (int)librdf_query_get_offset(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_set_offset ( SEXP query, SEXP offset, SEXP s_swig_copy)
{
  int result;
  librdf_query *arg1 = (librdf_query *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query, &argp1, SWIGTYPE_p_librdf_query, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_set_offset" "', argument " "1"" of type '" "librdf_query *""'"); 
  }
  arg1 = (librdf_query *)(argp1);
  arg2 = (int)(INTEGER(offset)[0]);
  result = (int)librdf_query_set_offset(arg1,arg2);
  r_ans = Rf_ScalarInteger(result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_as_stream ( SEXP query_results)
{
  librdf_stream *result = 0 ;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_as_stream" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (librdf_stream *)librdf_query_results_as_stream(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_stream_s, R_SWIG_OWNER |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_count ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_count" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_get_count(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_next ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_next" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_next(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_finished ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_finished" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_finished(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_binding_value ( SEXP query_results, SEXP offset)
{
  librdf_node *result = 0 ;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_binding_value" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  arg2 = (int)(INTEGER(offset)[0]);
  result = (librdf_node *)librdf_query_results_get_binding_value(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_binding_name ( SEXP query_results, SEXP offset)
{
  char *result = 0 ;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_binding_name" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  arg2 = (int)(INTEGER(offset)[0]);
  result = (char *)librdf_query_results_get_binding_name(arg1,arg2);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_binding_value_by_name ( SEXP query_results, SEXP name)
{
  librdf_node *result = 0 ;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_binding_value_by_name" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_query_results_get_binding_value_by_name" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (librdf_node *)librdf_query_results_get_binding_value_by_name(arg1,(char const *)arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_bindings_count ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_bindings_count" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_get_bindings_count(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_to_file2 ( SEXP query_results, SEXP name, SEXP mime_type, SEXP format_uri, SEXP base_uri, SEXP s_swig_copy)
{
  int result;
  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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_to_file2" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_query_results_to_file2" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(mime_type, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_query_results_to_file2" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_R_ConvertPtr(format_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_query_results_to_file2" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  res5 = SWIG_R_ConvertPtr(base_uri, &argp5, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_query_results_to_file2" "', argument " "5"" of type '" "librdf_uri *""'"); 
  }
  arg5 = (librdf_uri *)(argp5);
  result = (int)librdf_query_results_to_file2(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_to_string2 ( SEXP query_results, SEXP name, SEXP mime_type, SEXP format_uri, SEXP base_uri)
{
  char *result = 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 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_to_string2" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_query_results_to_string2" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(mime_type, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_query_results_to_string2" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_R_ConvertPtr(format_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_query_results_to_string2" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  res5 = SWIG_R_ConvertPtr(base_uri, &argp5, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "librdf_query_results_to_string2" "', argument " "5"" of type '" "librdf_uri *""'"); 
  }
  arg5 = (librdf_uri *)(argp5);
  result = (char *)librdf_query_results_to_string2(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_query_results ( SEXP query_results)
{
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_query_results" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  librdf_free_query_results(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_is_bindings ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_is_bindings" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_is_bindings(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_is_boolean ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_is_boolean" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_is_boolean(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_is_graph ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_is_graph" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_is_graph(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_is_syntax ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_is_syntax" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_is_syntax(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_query_results_get_boolean ( SEXP query_results, SEXP s_swig_copy)
{
  int result;
  librdf_query_results *arg1 = (librdf_query_results *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(query_results, &argp1, SWIGTYPE_p_librdf_query_results, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_query_results_get_boolean" "', argument " "1"" of type '" "librdf_query_results *""'"); 
  }
  arg1 = (librdf_query_results *)(argp1);
  result = (int)librdf_query_results_get_boolean(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_check_name ( SEXP world, SEXP name, SEXP s_swig_copy)
{
  int result;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_check_name" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_check_name" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  result = (int)librdf_serializer_check_name(arg1,(char const *)arg2);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_new_serializer ( SEXP world, SEXP name, SEXP mime_type, SEXP type_uri)
{
  librdf_serializer *result = 0 ;
  librdf_world *arg1 = (librdf_world *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  librdf_uri *arg4 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_new_serializer" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_new_serializer" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(mime_type, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_new_serializer" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  res4 = SWIG_R_ConvertPtr(type_uri, &argp4, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_new_serializer" "', argument " "4"" of type '" "librdf_uri *""'"); 
  }
  arg4 = (librdf_uri *)(argp4);
  result = (librdf_serializer *)librdf_new_serializer(arg1,(char const *)arg2,(char const *)arg3,arg4);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_serializer_s, R_SWIG_OWNER |  0 );
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_serializer ( SEXP serializer)
{
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_serializer" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  librdf_free_serializer(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_serialize_stream_to_file ( SEXP serializer, SEXP name, SEXP base_uri, SEXP stream, SEXP s_swig_copy)
{
  int result;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_stream *arg4 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_serialize_stream_to_file" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_serialize_stream_to_file" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(base_uri, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_serialize_stream_to_file" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_R_ConvertPtr(stream, &argp4, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_serializer_serialize_stream_to_file" "', argument " "4"" of type '" "librdf_stream *""'"); 
  }
  arg4 = (librdf_stream *)(argp4);
  result = (int)librdf_serializer_serialize_stream_to_file(arg1,(char const *)arg2,arg3,arg4);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_serialize_model_to_file ( SEXP serializer, SEXP name, SEXP inUriOrNull, SEXP model, SEXP s_swig_copy)
{
  int result;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  char *arg2 = (char *) 0 ;
  librdf_uri *arg3 = (librdf_uri *) 0 ;
  librdf_model *arg4 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_serialize_model_to_file" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_AsCharPtrAndSize(name, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_serialize_model_to_file" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_R_ConvertPtr(inUriOrNull, &argp3, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_serialize_model_to_file" "', argument " "3"" of type '" "librdf_uri *""'"); 
  }
  arg3 = (librdf_uri *)(argp3);
  res4 = SWIG_R_ConvertPtr(model, &argp4, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "librdf_serializer_serialize_model_to_file" "', argument " "4"" of type '" "librdf_model *""'"); 
  }
  arg4 = (librdf_model *)(argp4);
  result = (int)librdf_serializer_serialize_model_to_file(arg1,(char const *)arg2,arg3,arg4);
  r_ans = Rf_ScalarInteger(result);
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_serialize_stream_to_string ( SEXP serializer, SEXP base_uri, SEXP stream)
{
  char *result = 0 ;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_stream *arg3 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_serialize_stream_to_string" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_R_ConvertPtr(base_uri, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_serialize_stream_to_string" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(stream, &argp3, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_serialize_stream_to_string" "', argument " "3"" of type '" "librdf_stream *""'"); 
  }
  arg3 = (librdf_stream *)(argp3);
  result = (char *)librdf_serializer_serialize_stream_to_string(arg1,arg2,arg3);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_serialize_model_to_string ( SEXP serializer, SEXP inUriOrNull, SEXP model)
{
  char *result = 0 ;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_model *arg3 = (librdf_model *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_serialize_model_to_string" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_R_ConvertPtr(inUriOrNull, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_serialize_model_to_string" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(model, &argp3, SWIGTYPE_p_librdf_model_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_serialize_model_to_string" "', argument " "3"" of type '" "librdf_model *""'"); 
  }
  arg3 = (librdf_model *)(argp3);
  result = (char *)librdf_serializer_serialize_model_to_string(arg1,arg2,arg3);
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  
  
  
  free((char*)result);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_get_feature ( SEXP serializer, SEXP feature)
{
  librdf_node *result = 0 ;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_get_feature" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_get_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  result = (librdf_node *)librdf_serializer_get_feature(arg1,arg2);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_node_s, R_SWIG_EXTERNAL |  0 );
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_set_feature ( SEXP serializer, SEXP feature, SEXP value, SEXP s_swig_copy)
{
  int result;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  librdf_node *arg3 = (librdf_node *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_set_feature" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_R_ConvertPtr(feature, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_set_feature" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_R_ConvertPtr(value, &argp3, SWIGTYPE_p_librdf_node_s, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_set_feature" "', argument " "3"" of type '" "librdf_node *""'"); 
  }
  arg3 = (librdf_node *)(argp3);
  result = (int)librdf_serializer_set_feature(arg1,arg2,arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_serializer_set_namespace ( SEXP serializer, SEXP nspace, SEXP prefix, SEXP s_swig_copy)
{
  int result;
  librdf_serializer *arg1 = (librdf_serializer *) 0 ;
  librdf_uri *arg2 = (librdf_uri *) 0 ;
  char *arg3 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(serializer, &argp1, SWIGTYPE_p_librdf_serializer_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_serializer_set_namespace" "', argument " "1"" of type '" "librdf_serializer *""'"); 
  }
  arg1 = (librdf_serializer *)(argp1);
  res2 = SWIG_R_ConvertPtr(nspace, &argp2, SWIGTYPE_p_librdf_uri_s, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "librdf_serializer_set_namespace" "', argument " "2"" of type '" "librdf_uri *""'"); 
  }
  arg2 = (librdf_uri *)(argp2);
  res3 = SWIG_AsCharPtrAndSize(prefix, &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "librdf_serializer_set_namespace" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  result = (int)librdf_serializer_set_namespace(arg1,arg2,(char const *)arg3);
  r_ans = Rf_ScalarInteger(result);
  
  
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_free_stream ( SEXP stream)
{
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(stream, &argp1, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_free_stream" "', argument " "1"" of type '" "librdf_stream *""'"); 
  }
  arg1 = (librdf_stream *)(argp1);
  librdf_free_stream(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_stream_end ( SEXP stream, SEXP s_swig_copy)
{
  int result;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(stream, &argp1, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_stream_end" "', argument " "1"" of type '" "librdf_stream *""'"); 
  }
  arg1 = (librdf_stream *)(argp1);
  result = (int)librdf_stream_end(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_stream_next ( SEXP stream, SEXP s_swig_copy)
{
  int result;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(stream, &argp1, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_stream_next" "', argument " "1"" of type '" "librdf_stream *""'"); 
  }
  arg1 = (librdf_stream *)(argp1);
  result = (int)librdf_stream_next(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_stream_get_object ( SEXP stream)
{
  librdf_statement *result = 0 ;
  librdf_stream *arg1 = (librdf_stream *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(stream, &argp1, SWIGTYPE_p_librdf_stream_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_stream_get_object" "', argument " "1"" of type '" "librdf_stream *""'"); 
  }
  arg1 = (librdf_stream *)(argp1);
  result = (librdf_statement *)librdf_stream_get_object(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_statement_s, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_log_message_code ( SEXP message, SEXP s_swig_copy)
{
  int result;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(message, &argp1, SWIGTYPE_p_librdf_log_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_log_message_code" "', argument " "1"" of type '" "librdf_log_message *""'"); 
  }
  arg1 = (librdf_log_message *)(argp1);
  result = (int)librdf_log_message_code(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_log_message_level ( SEXP message, SEXP s_swig_copy)
{
  int result;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(message, &argp1, SWIGTYPE_p_librdf_log_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_log_message_level" "', argument " "1"" of type '" "librdf_log_message *""'"); 
  }
  arg1 = (librdf_log_message *)(argp1);
  result = (int)librdf_log_message_level(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_log_message_facility ( SEXP message, SEXP s_swig_copy)
{
  int result;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(message, &argp1, SWIGTYPE_p_librdf_log_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_log_message_facility" "', argument " "1"" of type '" "librdf_log_message *""'"); 
  }
  arg1 = (librdf_log_message *)(argp1);
  result = (int)librdf_log_message_facility(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_log_message_message ( SEXP message)
{
  char *result = 0 ;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(message, &argp1, SWIGTYPE_p_librdf_log_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_log_message_message" "', argument " "1"" of type '" "librdf_log_message *""'"); 
  }
  arg1 = (librdf_log_message *)(argp1);
  result = (char *)librdf_log_message_message(arg1);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_log_message_locator ( SEXP message)
{
  raptor_locator *result = 0 ;
  librdf_log_message *arg1 = (librdf_log_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(message, &argp1, SWIGTYPE_p_librdf_log_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_log_message_locator" "', argument " "1"" of type '" "librdf_log_message *""'"); 
  }
  arg1 = (librdf_log_message *)(argp1);
  result = (raptor_locator *)librdf_log_message_locator(arg1);
  r_ans = SWIG_R_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_raptor_locator, R_SWIG_EXTERNAL |  0 );
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_locator_line ( SEXP locator, SEXP s_swig_copy)
{
  int result;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(locator, &argp1, SWIGTYPE_p_raptor_locator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "raptor_locator_line" "', argument " "1"" of type '" "raptor_locator *""'"); 
  }
  arg1 = (raptor_locator *)(argp1);
  result = (int)raptor_locator_line(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_locator_column ( SEXP locator, SEXP s_swig_copy)
{
  int result;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(locator, &argp1, SWIGTYPE_p_raptor_locator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "raptor_locator_column" "', argument " "1"" of type '" "raptor_locator *""'"); 
  }
  arg1 = (raptor_locator *)(argp1);
  result = (int)raptor_locator_column(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_locator_byte ( SEXP locator, SEXP s_swig_copy)
{
  int result;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(locator, &argp1, SWIGTYPE_p_raptor_locator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "raptor_locator_byte" "', argument " "1"" of type '" "raptor_locator *""'"); 
  }
  arg1 = (raptor_locator *)(argp1);
  result = (int)raptor_locator_byte(arg1);
  r_ans = Rf_ScalarInteger(result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_locator_file ( SEXP locator)
{
  char *result = 0 ;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(locator, &argp1, SWIGTYPE_p_raptor_locator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "raptor_locator_file" "', argument " "1"" of type '" "raptor_locator *""'"); 
  }
  arg1 = (raptor_locator *)(argp1);
  result = (char *)raptor_locator_file(arg1);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_locator_uri ( SEXP locator)
{
  char *result = 0 ;
  raptor_locator *arg1 = (raptor_locator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(locator, &argp1, SWIGTYPE_p_raptor_locator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "raptor_locator_uri" "', argument " "1"" of type '" "raptor_locator *""'"); 
  }
  arg1 = (raptor_locator *)(argp1);
  result = (char *)raptor_locator_uri(arg1);
  r_ans = SWIG_FromCharPtr((const char *)result);
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_internal_test_error ( SEXP world)
{
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_internal_test_error" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  librdf_internal_test_error(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_internal_test_warning ( SEXP world)
{
  librdf_world *arg1 = (librdf_world *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  res1 = SWIG_R_ConvertPtr(world, &argp1, SWIGTYPE_p_librdf_world_s, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "librdf_internal_test_warning" "', argument " "1"" of type '" "librdf_world *""'"); 
  }
  arg1 = (librdf_world *)(argp1);
  librdf_internal_test_warning(arg1);
  r_ans = R_NilValue;
  
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_short_copyright_string_get ( SEXP s_swig_copy)
{
  char *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (char *)(char *)librdf_short_copyright_string;
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_copyright_string_get ( SEXP s_swig_copy)
{
  char *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (char *)(char *)librdf_copyright_string;
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_version_string_get ( SEXP s_swig_copy)
{
  char *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (char *)(char *)librdf_version_string;
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_version_major_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)librdf_version_major;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_version_minor_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)librdf_version_minor;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_version_release_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)librdf_version_release;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_librdf_version_decimal_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)librdf_version_decimal;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_version_string_get ( SEXP s_swig_copy)
{
  char *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (char *)(char *)raptor_version_string;
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_version_major_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)raptor_version_major;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_version_minor_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)raptor_version_minor;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_version_release_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)raptor_version_release;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_raptor_version_decimal_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)raptor_version_decimal;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_rasqal_version_string_get ( SEXP s_swig_copy)
{
  char *result = 0 ;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (char *)(char *)rasqal_version_string;
  r_ans = result ? Rf_mkString((char *)(result)) : R_NilValue;
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_rasqal_version_major_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)rasqal_version_major;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_rasqal_version_minor_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)rasqal_version_minor;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_rasqal_version_release_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)rasqal_version_release;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


SWIGEXPORT SEXP
R_swig_rasqal_version_decimal_get ( SEXP s_swig_copy)
{
  unsigned int result;
  unsigned int r_nprotect = 0;
  SEXP r_ans = R_NilValue ;
  VMAXTYPE r_vmax = vmaxget() ;
  
  result = (unsigned int)(unsigned int)rasqal_version_decimal;
  r_ans = SWIG_From_unsigned_SS_int((unsigned int)(result));
  vmaxset(r_vmax);
  if(r_nprotect)  Rf_unprotect(r_nprotect);
  
  return r_ans;
}


#ifdef __cplusplus
}
#endif

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

static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
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_char,
  &_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_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
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_char,
  _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 statically to an initial
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded.
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

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

#if 0
#define SWIGRUNTIME_DEBUG
#endif


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

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

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

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

#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

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

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {

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

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

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

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

  if (init_run) return;
  init_run = 1;

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

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


SWIGEXPORT void SWIG_init(void) {


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

}
#include <R_ext/Rdynload.h>

extern SEXP isnull(SEXP);

SWIGINTERN R_CallMethodDef CallEntries[] = {
   {"isnull", (DL_FUNC) &isnull, 1},
   {"R_swig_librdf_parser_set_feature", (DL_FUNC) &R_swig_librdf_parser_set_feature, 4},
   {"R_swig_librdf_parser_get_feature", (DL_FUNC) &R_swig_librdf_parser_get_feature, 2},
   {"R_swig_librdf_model_set_feature", (DL_FUNC) &R_swig_librdf_model_set_feature, 4},
   {"R_swig_librdf_model_get_feature", (DL_FUNC) &R_swig_librdf_model_get_feature, 2},
   {"R_swig_librdf_world_set_feature", (DL_FUNC) &R_swig_librdf_world_set_feature, 4},
   {"R_swig_librdf_world_get_feature", (DL_FUNC) &R_swig_librdf_world_get_feature, 2},
   {"R_swig_librdf_serializer_get_feature", (DL_FUNC) &R_swig_librdf_serializer_get_feature, 2},
   {"R_swig_librdf_serializer_set_feature", (DL_FUNC) &R_swig_librdf_serializer_set_feature, 4},
   {"R_swig_librdf_model_to_string", (DL_FUNC) &R_swig_librdf_model_to_string, 5},
   {"R_swig_librdf_new_node_from_uri_string", (DL_FUNC) &R_swig_librdf_new_node_from_uri_string, 2},
   {"R_swig_librdf_uri_to_string", (DL_FUNC) &R_swig_librdf_uri_to_string, 1},
   {"R_swig_librdf_digest_update_string", (DL_FUNC) &R_swig_librdf_digest_update_string, 2},
   {"R_swig_librdf_digest_to_string", (DL_FUNC) &R_swig_librdf_digest_to_string, 1},
   {"R_swig_librdf_new_hash_from_string", (DL_FUNC) &R_swig_librdf_new_hash_from_string, 3},
   {"R_swig_librdf_hash_to_string", (DL_FUNC) &R_swig_librdf_hash_to_string, 2},
   {"R_swig_librdf_new_node_from_normalised_uri_string", (DL_FUNC) &R_swig_librdf_new_node_from_normalised_uri_string, 4},
   {"R_swig_librdf_serializer_serialize_model_to_string", (DL_FUNC) &R_swig_librdf_serializer_serialize_model_to_string, 3},
   {"R_swig_librdf_stream_end", (DL_FUNC) &R_swig_librdf_stream_end, 2},
   {"R_swig_librdf_internal_test_error", (DL_FUNC) &R_swig_librdf_internal_test_error, 1},
   {"R_swig_librdf_query_results_get_binding_name", (DL_FUNC) &R_swig_librdf_query_results_get_binding_name, 2},
   {"R_swig_librdf_digest_init", (DL_FUNC) &R_swig_librdf_digest_init, 1},
   {"R_swig_librdf_query_set_limit", (DL_FUNC) &R_swig_librdf_query_set_limit, 3},
   {"R_swig_librdf_query_get_limit", (DL_FUNC) &R_swig_librdf_query_get_limit, 2},
   {"R_swig_librdf_model_get_contexts", (DL_FUNC) &R_swig_librdf_model_get_contexts, 1},
   {"R_swig_librdf_model_sync", (DL_FUNC) &R_swig_librdf_model_sync, 1},
   {"R_swig_librdf_free_hash", (DL_FUNC) &R_swig_librdf_free_hash, 1},
   {"R_swig_librdf_query_results_is_bindings", (DL_FUNC) &R_swig_librdf_query_results_is_bindings, 2},
   {"R_swig_librdf_query_results_finished", (DL_FUNC) &R_swig_librdf_query_results_finished, 2},
   {"R_swig_librdf_parser_get_accept_header", (DL_FUNC) &R_swig_librdf_parser_get_accept_header, 1},
   {"R_swig_librdf_serializer_serialize_model_to_file", (DL_FUNC) &R_swig_librdf_serializer_serialize_model_to_file, 5},
   {"R_swig_librdf_serializer_serialize_stream_to_file", (DL_FUNC) &R_swig_librdf_serializer_serialize_stream_to_file, 5},
   {"R_swig_raptor_locator_uri", (DL_FUNC) &R_swig_raptor_locator_uri, 1},
   {"R_swig_librdf_model_get_arcs_out", (DL_FUNC) &R_swig_librdf_model_get_arcs_out, 2},
   {"R_swig_librdf_query_results_is_graph", (DL_FUNC) &R_swig_librdf_query_results_is_graph, 2},
   {"R_swig_librdf_model_get_arc", (DL_FUNC) &R_swig_librdf_model_get_arc, 3},
   {"R_swig_raptor_locator_byte", (DL_FUNC) &R_swig_raptor_locator_byte, 2},
   {"R_swig_librdf_model_get_arcs_in", (DL_FUNC) &R_swig_librdf_model_get_arcs_in, 2},
   {"R_swig_librdf_node_get_literal_value_as_latin1", (DL_FUNC) &R_swig_librdf_node_get_literal_value_as_latin1, 1},
   {"R_swig_raptor_locator_file", (DL_FUNC) &R_swig_raptor_locator_file, 1},
   {"R_swig_librdf_free_node", (DL_FUNC) &R_swig_librdf_free_node, 1},
   {"R_swig_librdf_iterator_get_object", (DL_FUNC) &R_swig_librdf_iterator_get_object, 1},
   {"R_swig_librdf_statement_get_object", (DL_FUNC) &R_swig_librdf_statement_get_object, 1},
   {"R_swig_librdf_statement_set_object", (DL_FUNC) &R_swig_librdf_statement_set_object, 2},
   {"R_swig_librdf_stream_get_object", (DL_FUNC) &R_swig_librdf_stream_get_object, 1},
   {"R_swig_librdf_free_parser", (DL_FUNC) &R_swig_librdf_free_parser, 1},
   {"R_swig_librdf_new_parser", (DL_FUNC) &R_swig_librdf_new_parser, 4},
   {"R_swig_librdf_new_node_from_uri", (DL_FUNC) &R_swig_librdf_new_node_from_uri, 2},
   {"R_swig_librdf_new_uri_from_uri", (DL_FUNC) &R_swig_librdf_new_uri_from_uri, 1},
   {"R_swig_librdf_new_model_with_options", (DL_FUNC) &R_swig_librdf_new_model_with_options, 3},
   {"R_swig_librdf_free_uri", (DL_FUNC) &R_swig_librdf_free_uri, 1},
   {"R_swig_librdf_new_hash_from_array_of_strings", (DL_FUNC) &R_swig_librdf_new_hash_from_array_of_strings, 3},
   {"R_swig_librdf_free_iterator", (DL_FUNC) &R_swig_librdf_free_iterator, 1},
   {"R_swig_librdf_query_results_next", (DL_FUNC) &R_swig_librdf_query_results_next, 2},
   {"R_swig_librdf_short_copyright_string_get", (DL_FUNC) &R_swig_librdf_short_copyright_string_get, 1},
   {"R_swig_librdf_copyright_string_get", (DL_FUNC) &R_swig_librdf_copyright_string_get, 1},
   {"R_swig_librdf_version_string_get", (DL_FUNC) &R_swig_librdf_version_string_get, 1},
   {"R_swig_raptor_version_string_get", (DL_FUNC) &R_swig_raptor_version_string_get, 1},
   {"R_swig_rasqal_version_string_get", (DL_FUNC) &R_swig_rasqal_version_string_get, 1},
   {"R_swig_librdf_query_results_as_stream", (DL_FUNC) &R_swig_librdf_query_results_as_stream, 1},
   {"R_swig_librdf_parser_parse_string_as_stream", (DL_FUNC) &R_swig_librdf_parser_parse_string_as_stream, 3},
   {"R_swig_librdf_parser_parse_as_stream", (DL_FUNC) &R_swig_librdf_parser_parse_as_stream, 3},
   {"R_swig_librdf_model_context_as_stream", (DL_FUNC) &R_swig_librdf_model_context_as_stream, 2},
   {"R_swig_librdf_model_as_stream", (DL_FUNC) &R_swig_librdf_model_as_stream, 1},
   {"R_swig_librdf_free_stream", (DL_FUNC) &R_swig_librdf_free_stream, 1},
   {"R_swig_librdf_digest_update", (DL_FUNC) &R_swig_librdf_digest_update, 3},
   {"R_swig_librdf_parser_parse_counted_string_into_model", (DL_FUNC) &R_swig_librdf_parser_parse_counted_string_into_model, 6},
   {"R_swig_librdf_query_set_offset", (DL_FUNC) &R_swig_librdf_query_set_offset, 3},
   {"R_swig_librdf_query_get_offset", (DL_FUNC) &R_swig_librdf_query_get_offset, 2},
   {"R_swig_librdf_node_get_literal_value_is_wf_xml", (DL_FUNC) &R_swig_librdf_node_get_literal_value_is_wf_xml, 2},
   {"R_swig_librdf_model_transaction_rollback", (DL_FUNC) &R_swig_librdf_model_transaction_rollback, 2},
   {"R_swig_librdf_parser_guess_name2", (DL_FUNC) &R_swig_librdf_parser_guess_name2, 4},
   {"R_swig_librdf_model_has_arc_in", (DL_FUNC) &R_swig_librdf_model_has_arc_in, 4},
   {"R_swig_librdf_query_execute", (DL_FUNC) &R_swig_librdf_query_execute, 2},
   {"R_swig_librdf_model_query_execute", (DL_FUNC) &R_swig_librdf_model_query_execute, 2},
   {"R_swig_librdf_query_results_get_binding_value", (DL_FUNC) &R_swig_librdf_query_results_get_binding_value, 2},
   {"R_swig_librdf_query_results_is_syntax", (DL_FUNC) &R_swig_librdf_query_results_is_syntax, 2},
   {"R_swig_librdf_model_contains_context", (DL_FUNC) &R_swig_librdf_model_contains_context, 3},
   {"R_swig_librdf_model_find_statements_in_context", (DL_FUNC) &R_swig_librdf_model_find_statements_in_context, 3},
   {"R_swig_librdf_iterator_get_context", (DL_FUNC) &R_swig_librdf_iterator_get_context, 1},
   {"R_swig_librdf_version_release_get", (DL_FUNC) &R_swig_librdf_version_release_get, 1},
   {"R_swig_raptor_version_release_get", (DL_FUNC) &R_swig_raptor_version_release_get, 1},
   {"R_swig_rasqal_version_release_get", (DL_FUNC) &R_swig_rasqal_version_release_get, 1},
   {"R_swig_librdf_model_load", (DL_FUNC) &R_swig_librdf_model_load, 6},
   {"R_swig_librdf_new_hash", (DL_FUNC) &R_swig_librdf_new_hash, 2},
   {"R_swig_librdf_statement_is_complete", (DL_FUNC) &R_swig_librdf_statement_is_complete, 2},
   {"R_swig_librdf_serializer_serialize_stream_to_string", (DL_FUNC) &R_swig_librdf_serializer_serialize_stream_to_string, 3},
   {"R_swig_librdf_log_message_level", (DL_FUNC) &R_swig_librdf_log_message_level, 2},
   {"R_swig_librdf_query_results_get_bindings_count", (DL_FUNC) &R_swig_librdf_query_results_get_bindings_count, 2},
   {"R_swig_librdf_model_has_arc_out", (DL_FUNC) &R_swig_librdf_model_has_arc_out, 4},
   {"R_swig_librdf_statement_get_predicate", (DL_FUNC) &R_swig_librdf_statement_get_predicate, 1},
   {"R_swig_librdf_statement_set_predicate", (DL_FUNC) &R_swig_librdf_statement_set_predicate, 2},
   {"R_swig_librdf_model_context_remove_statement", (DL_FUNC) &R_swig_librdf_model_context_remove_statement, 4},
   {"R_swig_librdf_model_context_add_statement", (DL_FUNC) &R_swig_librdf_model_context_add_statement, 4},
   {"R_swig_librdf_model_contains_statement", (DL_FUNC) &R_swig_librdf_model_contains_statement, 3},
   {"R_swig_librdf_model_remove_statement", (DL_FUNC) &R_swig_librdf_model_remove_statement, 3},
   {"R_swig_librdf_model_add_statement", (DL_FUNC) &R_swig_librdf_model_add_statement, 3},
   {"R_swig_librdf_model_add_typed_literal_statement", (DL_FUNC) &R_swig_librdf_model_add_typed_literal_statement, 7},
   {"R_swig_librdf_model_add_string_literal_statement", (DL_FUNC) &R_swig_librdf_model_add_string_literal_statement, 7},
   {"R_swig_librdf_new_statement", (DL_FUNC) &R_swig_librdf_new_statement, 1},
   {"R_swig_librdf_new_statement_from_statement", (DL_FUNC) &R_swig_librdf_new_statement_from_statement, 1},
   {"R_swig_librdf_free_statement", (DL_FUNC) &R_swig_librdf_free_statement, 1},
   {"R_swig_librdf_statement_match", (DL_FUNC) &R_swig_librdf_statement_match, 3},
   {"R_swig_librdf_node_get_li_ordinal", (DL_FUNC) &R_swig_librdf_node_get_li_ordinal, 2},
   {"R_swig_librdf_model_get_target", (DL_FUNC) &R_swig_librdf_model_get_target, 3},
   {"R_swig_librdf_serializer_check_name", (DL_FUNC) &R_swig_librdf_serializer_check_name, 3},
   {"R_swig_librdf_parser_check_name", (DL_FUNC) &R_swig_librdf_parser_check_name, 3},
   {"R_swig_librdf_query_results_to_file2", (DL_FUNC) &R_swig_librdf_query_results_to_file2, 6},
   {"R_swig_librdf_new_node_from_node", (DL_FUNC) &R_swig_librdf_new_node_from_node, 1},
   {"R_swig_librdf_internal_test_warning", (DL_FUNC) &R_swig_librdf_internal_test_warning, 1},
   {"R_swig_librdf_world_open", (DL_FUNC) &R_swig_librdf_world_open, 1},
   {"R_swig_librdf_model_get_source", (DL_FUNC) &R_swig_librdf_model_get_source, 3},
   {"R_swig_librdf_node_is_resource", (DL_FUNC) &R_swig_librdf_node_is_resource, 2},
   {"R_swig_raptor_locator_column", (DL_FUNC) &R_swig_raptor_locator_column, 2},
   {"R_swig_librdf_free_serializer", (DL_FUNC) &R_swig_librdf_free_serializer, 1},
   {"R_swig_librdf_new_serializer", (DL_FUNC) &R_swig_librdf_new_serializer, 4},
   {"R_swig_librdf_model_get_targets", (DL_FUNC) &R_swig_librdf_model_get_targets, 3},
   {"R_swig_librdf_node_get_literal_value", (DL_FUNC) &R_swig_librdf_node_get_literal_value, 1},
   {"R_swig_librdf_model_transaction_commit", (DL_FUNC) &R_swig_librdf_model_transaction_commit, 2},
   {"R_swig_librdf_parser_parse_counted_string_as_stream", (DL_FUNC) &R_swig_librdf_parser_parse_counted_string_as_stream, 4},
   {"R_swig_librdf_free_query_results", (DL_FUNC) &R_swig_librdf_free_query_results, 1},
   {"R_swig_librdf_world_set_logger", (DL_FUNC) &R_swig_librdf_world_set_logger, 3},
   {"R_swig_librdf_query_results_get_count", (DL_FUNC) &R_swig_librdf_query_results_get_count, 2},
   {"R_swig_librdf_parser_get_namespaces_seen_count", (DL_FUNC) &R_swig_librdf_parser_get_namespaces_seen_count, 2},
   {"R_swig_librdf_model_transaction_start", (DL_FUNC) &R_swig_librdf_model_transaction_start, 2},
   {"R_swig_librdf_new_node", (DL_FUNC) &R_swig_librdf_new_node, 1},
   {"R_swig_librdf_node_get_literal_value_language", (DL_FUNC) &R_swig_librdf_node_get_literal_value_language, 1},
   {"R_swig_librdf_new_digest", (DL_FUNC) &R_swig_librdf_new_digest, 2},
   {"R_swig_librdf_free_digest", (DL_FUNC) &R_swig_librdf_free_digest, 1},
   {"R_swig_librdf_node_get_literal_value_datatype_uri", (DL_FUNC) &R_swig_librdf_node_get_literal_value_datatype_uri, 1},
   {"R_swig_librdf_log_message_message", (DL_FUNC) &R_swig_librdf_log_message_message, 1},
   {"R_swig_librdf_new_node_from_literal", (DL_FUNC) &R_swig_librdf_new_node_from_literal, 4},
   {"R_swig_librdf_new_node_from_typed_literal", (DL_FUNC) &R_swig_librdf_new_node_from_typed_literal, 4},
   {"R_swig_librdf_node_is_literal", (DL_FUNC) &R_swig_librdf_node_is_literal, 2},
   {"R_swig_librdf_parser_parse_string_into_model", (DL_FUNC) &R_swig_librdf_parser_parse_string_into_model, 5},
   {"R_swig_librdf_parser_parse_into_model", (DL_FUNC) &R_swig_librdf_parser_parse_into_model, 5},
   {"R_swig_librdf_new_model", (DL_FUNC) &R_swig_librdf_new_model, 3},
   {"R_swig_librdf_new_model_from_model", (DL_FUNC) &R_swig_librdf_new_model_from_model, 1},
   {"R_swig_librdf_free_model", (DL_FUNC) &R_swig_librdf_free_model, 1},
   {"R_swig_librdf_log_message_locator", (DL_FUNC) &R_swig_librdf_log_message_locator, 1},
   {"R_swig_librdf_parser_get_namespaces_seen_prefix", (DL_FUNC) &R_swig_librdf_parser_get_namespaces_seen_prefix, 2},
   {"R_swig_librdf_free_query", (DL_FUNC) &R_swig_librdf_free_query, 1},
   {"R_swig_librdf_new_query_from_query", (DL_FUNC) &R_swig_librdf_new_query_from_query, 1},
   {"R_swig_librdf_new_query", (DL_FUNC) &R_swig_librdf_new_query, 5},
   {"R_swig_librdf_new_statement_from_nodes", (DL_FUNC) &R_swig_librdf_new_statement_from_nodes, 4},
   {"R_swig_librdf_node_is_blank", (DL_FUNC) &R_swig_librdf_node_is_blank, 2},
   {"R_swig_librdf_new_node_from_blank_identifier", (DL_FUNC) &R_swig_librdf_new_node_from_blank_identifier, 2},
   {"R_swig_librdf_node_get_blank_identifier", (DL_FUNC) &R_swig_librdf_node_get_blank_identifier, 1},
   {"R_swig_librdf_statement_get_subject", (DL_FUNC) &R_swig_librdf_statement_get_subject, 1},
   {"R_swig_librdf_statement_set_subject", (DL_FUNC) &R_swig_librdf_statement_set_subject, 2},
   {"R_swig_librdf_stream_next", (DL_FUNC) &R_swig_librdf_stream_next, 2},
   {"R_swig_librdf_version_major_get", (DL_FUNC) &R_swig_librdf_version_major_get, 1},
   {"R_swig_librdf_version_minor_get", (DL_FUNC) &R_swig_librdf_version_minor_get, 1},
   {"R_swig_raptor_version_major_get", (DL_FUNC) &R_swig_raptor_version_major_get, 1},
   {"R_swig_raptor_version_minor_get", (DL_FUNC) &R_swig_raptor_version_minor_get, 1},
   {"R_swig_rasqal_version_major_get", (DL_FUNC) &R_swig_rasqal_version_major_get, 1},
   {"R_swig_rasqal_version_minor_get", (DL_FUNC) &R_swig_rasqal_version_minor_get, 1},
   {"R_swig_librdf_model_add", (DL_FUNC) &R_swig_librdf_model_add, 5},
   {"R_swig_librdf_model_get_arcs", (DL_FUNC) &R_swig_librdf_model_get_arcs, 3},
   {"R_swig_librdf_log_message_facility", (DL_FUNC) &R_swig_librdf_log_message_facility, 2},
   {"R_swig_librdf_node_get_type", (DL_FUNC) &R_swig_librdf_node_get_type, 2},
   {"R_swig_librdf_query_results_get_binding_value_by_name", (DL_FUNC) &R_swig_librdf_query_results_get_binding_value_by_name, 2},
   {"R_swig_librdf_new_world", (DL_FUNC) &R_swig_librdf_new_world, 0},
   {"R_swig_librdf_free_world", (DL_FUNC) &R_swig_librdf_free_world, 1},
   {"R_swig_librdf_iterator_next", (DL_FUNC) &R_swig_librdf_iterator_next, 2},
   {"R_swig_librdf_serializer_set_namespace", (DL_FUNC) &R_swig_librdf_serializer_set_namespace, 4},
   {"R_swig_librdf_query_results_get_boolean", (DL_FUNC) &R_swig_librdf_query_results_get_boolean, 2},
   {"R_swig_librdf_query_results_is_boolean", (DL_FUNC) &R_swig_librdf_query_results_is_boolean, 2},
   {"R_swig_raptor_locator_line", (DL_FUNC) &R_swig_raptor_locator_line, 2},
   {"R_swig_librdf_model_context_remove_statements", (DL_FUNC) &R_swig_librdf_model_context_remove_statements, 3},
   {"R_swig_librdf_model_context_add_statements", (DL_FUNC) &R_swig_librdf_model_context_add_statements, 4},
   {"R_swig_librdf_model_find_statements", (DL_FUNC) &R_swig_librdf_model_find_statements, 2},
   {"R_swig_librdf_model_add_statements", (DL_FUNC) &R_swig_librdf_model_add_statements, 3},
   {"R_swig_librdf_digest_final", (DL_FUNC) &R_swig_librdf_digest_final, 1},
   {"R_swig_librdf_new_uri_from_filename", (DL_FUNC) &R_swig_librdf_new_uri_from_filename, 2},
   {"R_swig_librdf_iterator_end", (DL_FUNC) &R_swig_librdf_iterator_end, 2},
   {"R_swig_librdf_uri_equals", (DL_FUNC) &R_swig_librdf_uri_equals, 3},
   {"R_swig_librdf_node_equals", (DL_FUNC) &R_swig_librdf_node_equals, 3},
   {"R_swig_librdf_statement_equals", (DL_FUNC) &R_swig_librdf_statement_equals, 3},
   {"R_swig_librdf_node_get_uri", (DL_FUNC) &R_swig_librdf_node_get_uri, 1},
   {"R_swig_librdf_free_storage", (DL_FUNC) &R_swig_librdf_free_storage, 1},
   {"R_swig_librdf_new_storage_from_storage", (DL_FUNC) &R_swig_librdf_new_storage_from_storage, 1},
   {"R_swig_librdf_new_storage", (DL_FUNC) &R_swig_librdf_new_storage, 4},
   {"R_swig_librdf_model_size", (DL_FUNC) &R_swig_librdf_model_size, 2},
   {"R_swig_librdf_query_results_to_string2", (DL_FUNC) &R_swig_librdf_query_results_to_string2, 5},
   {"R_swig_librdf_log_message_code", (DL_FUNC) &R_swig_librdf_log_message_code, 2},
   {"R_swig_librdf_version_decimal_get", (DL_FUNC) &R_swig_librdf_version_decimal_get, 1},
   {"R_swig_raptor_version_decimal_get", (DL_FUNC) &R_swig_raptor_version_decimal_get, 1},
   {"R_swig_rasqal_version_decimal_get", (DL_FUNC) &R_swig_rasqal_version_decimal_get, 1},
   {"R_swig_librdf_new_node_from_uri_local_name", (DL_FUNC) &R_swig_librdf_new_node_from_uri_local_name, 3},
   {"R_swig_librdf_uri_compare", (DL_FUNC) &R_swig_librdf_uri_compare, 3},
   {"R_swig_librdf_new_uri", (DL_FUNC) &R_swig_librdf_new_uri, 2},
   {"R_swig_librdf_model_get_sources", (DL_FUNC) &R_swig_librdf_model_get_sources, 3},
   {"R_swig_librdf_parser_get_namespaces_seen_uri", (DL_FUNC) &R_swig_librdf_parser_get_namespaces_seen_uri, 2},
   {NULL, NULL, 0}
};

SWIGEXPORT void R_init_redland(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
