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

#define SWIG_MODULE "gv"


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#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__)
#   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
#define SWIG_POINTER_NO_NULL       0x4

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

/* -----------------------------------------------------------------------------
 * ocamlrundec.swg
 *
 * Ocaml runtime code -- declarations
 * ----------------------------------------------------------------------------- */

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

#ifdef __cplusplus
#define SWIGEXT extern "C"
SWIGEXT {
#else
#define SWIGEXT 
#endif
#define value caml_value_t
#define CAML_VALUE caml_value_t
#define CAML_NAME_SPACE
#include <caml/alloc.h>
#include <caml/custom.h>
#include <caml/mlvalues.h>
#include <caml/memory.h>
#include <caml/callback.h>
#include <caml/fail.h>
#include <caml/misc.h>

#if defined(CAMLassert)
/* Both this macro and version.h were introduced in version 4.02.0 */
#include <caml/version.h>
#else
#define OCAML_VERSION 0 /* Unknown, but < 40200 */
#endif

#define caml_array_set swig_caml_array_set

/* Adapted from memory.h and mlvalues.h */

#define SWIG_CAMLlocal1(x) \
  caml_value_t x = 0; \
  CAMLxparam1 (x)

#define SWIG_CAMLlocal2(x, y) \
  caml_value_t x = 0, y = 0; \
  CAMLxparam2 (x, y)

#define SWIG_CAMLlocal3(x, y, z) \
  caml_value_t x = 0, y = 0, z = 0; \
  CAMLxparam3 (x, y, z)

#define SWIG_CAMLlocal4(x, y, z, t) \
  caml_value_t x = 0, y = 0, z = 0, t = 0; \
  CAMLxparam4 (x, y, z, t)

#define SWIG_CAMLlocal5(x, y, z, t, u) \
  caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \
  CAMLxparam5 (x, y, z, t, u)

#define SWIG_CAMLlocalN(x, size) \
  caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \
  CAMLxparamN (x, (size))

#define SWIG_Field(x, i) (((caml_value_t *)(x)) [i])           /* Also an l-value. */
#define SWIG_Store_field(block, offset, val) do{ \
  mlsize_t caml__temp_offset = (offset); \
  caml_value_t caml__temp_val = (val); \
  caml_modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \
}while(0)

#define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1))
#ifdef ARCH_BIG_ENDIAN
#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1])
                                                 /* Also an l-value. */
#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1])
                                                 /* Also an l-value. */
#else
#define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)])
                                                 /* Also an l-value. */
#define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0])
                                                 /* Also an l-value. */
#endif

#ifdef CAMLreturn0
#undef CAMLreturn0
#endif
#define CAMLreturn0 do{ \
  caml_local_roots = caml__frame; \
  return; \
}while (0)

#ifdef CAMLreturn
#undef CAMLreturn
#endif
#define CAMLreturn(result) do{ \
  caml_value_t caml__temp_result = (result); \
  caml_local_roots = caml__frame; \
  return (caml__temp_result); \
}while(0)

#define CAMLreturn_type(result) do{ \
  caml_local_roots = caml__frame; \
  return result; \
}while(0)

#ifdef CAMLnoreturn
#undef CAMLnoreturn
#endif
#define CAMLnoreturn ((void) caml__frame)


#ifndef ARCH_ALIGN_INT64
#if OCAML_VERSION >= 40300
#define SWIG_Int64_val(v) (*((int64_t *) SWIG_Data_custom_val(v)))
#else
#define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v)))
#endif
#else
#if OCAML_VERSION >= 40300
CAMLextern int64_t Int64_val(caml_value_t v);
#else
CAMLextern int64 Int64_val(caml_value_t v);
#endif
#define SWIG_Int64_val(v) Int64_val(v)
#endif

#define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type)
#define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer)

typedef enum {
  SWIG_OCamlArithmeticException,
  SWIG_OCamlDirectorPureVirtual,
  SWIG_OCamlOutOfMemoryError,
  SWIG_OCamlOverflowException,
  SWIG_OCamlIllegalArgumentException,
  SWIG_OCamlIndexOutOfBoundsException,
  SWIG_OCamlRuntimeException,
  SWIG_OCamlSystemException,
  SWIG_OCamlUnknownError
} SWIG_OCamlExceptionCodes;

SWIGINTERN void SWIG_OCamlThrowException(SWIG_OCamlExceptionCodes code, const char *msg) {
  CAMLparam0();
  SWIG_CAMLlocal1(str);

  switch (code) {
  case SWIG_OCamlIllegalArgumentException:
    caml_invalid_argument(msg);
    break;
  case SWIG_OCamlSystemException:
    str = caml_copy_string(msg);
    caml_raise_sys_error(str);
    break;
  case SWIG_OCamlArithmeticException:
  case SWIG_OCamlIndexOutOfBoundsException:
  case SWIG_OCamlOutOfMemoryError:
  case SWIG_OCamlOverflowException:
  case SWIG_OCamlRuntimeException:
  case SWIG_OCamlUnknownError:
  default:
    caml_failwith(msg);
    break;
  }
  CAMLreturn0;
}

#define SWIG_contract_assert(expr, msg) if(!(expr)) {SWIG_OCamlThrowException(SWIG_OCamlRuntimeException, msg);}

    SWIGINTERN int
    SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type);

    SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n );
    SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt );
    SWIGINTERN int caml_list_length( CAML_VALUE lst );
    SWIGINTERN CAML_VALUE caml_array_new( int n );
    SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item );
    SWIGINTERN CAML_VALUE caml_array_nth( CAML_VALUE arr, int n );
    SWIGINTERN int caml_array_len( CAML_VALUE arr );

    SWIGINTERN CAML_VALUE caml_val_char( char c );
    SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char c );

    SWIGINTERN CAML_VALUE caml_val_short( short s );
    SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short s );
    
    SWIGINTERN CAML_VALUE caml_val_int( int x );
    SWIGINTERN CAML_VALUE caml_val_uint( unsigned int x );

    SWIGINTERN CAML_VALUE caml_val_long( long x );
    SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long x );

    SWIGINTERN CAML_VALUE caml_val_float( float f );
    SWIGINTERN CAML_VALUE caml_val_double( double d );

    SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor );

    SWIGINTERN CAML_VALUE caml_val_string( const char *str );
    SWIGINTERN CAML_VALUE caml_val_string_len( const char *str, int len );

    SWIGINTERN long caml_long_val( CAML_VALUE v );
    SWIGINTERN double caml_double_val( CAML_VALUE v );

    SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out,
				      swig_type_info *descriptor );
    SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor );

    SWIGINTERN char *caml_string_val( CAML_VALUE v );
    SWIGINTERN int caml_string_len( CAML_VALUE v );

#ifdef __cplusplus
}
#endif

/* -*-c-*- */

/* SWIG pointer structure */

#include <string.h>
#include <assert.h>

#ifdef __cplusplus
extern "C" {
#endif

#define C_bool 0
#define C_char 1
#define C_uchar 2
#define C_short 3
#define C_ushort 4
#define C_int 5
#define C_uint 6
#define C_int32 7
#define C_int64 8
#define C_float 9
#define C_double 10
#define C_ptr 11
#define C_array 12
#define C_list 13
#define C_obj 14
#define C_string 15
#define C_enum 16
#define C_director_core 17


/* Cast a pointer if possible; returns 1 if successful */
    
    SWIGINTERN int
    SWIG_Cast (void *source, swig_type_info *source_type,
	       void **ptr, swig_type_info *dest_type)
    {
	if( !source ) { /* Special case for NULL.  This is a popular question
	     for other modules on the list, so I want an easy way out... */
	    *ptr = 0;
	    return 0;
	}

#ifdef TYPE_CAST_VERBOSE
	fprintf( stderr, "Trying to cast %s to %s\n", 
		 source_type ? source_type->str : "<none>",
		 dest_type ? dest_type->str : "<none>" );
#endif
	if (dest_type != source_type) {
	    /* We have a type mismatch.  Will have to look through our type
	       mapping table to figure out whether or not we can accept this
	       datatype. 
	       --
	       Ignore typechecks for void *.  Allow any conversion. */
	    if( !dest_type || !source_type || 
		!strcmp(dest_type->name,"_p_void") ||
		!strcmp(source_type->name,"_p_void") ) {
		*ptr = source;
		return 0;
	    } else {
		swig_cast_info *tc = 
		    SWIG_TypeCheckStruct(source_type, dest_type );
#ifdef TYPE_CAST_VERBOSE
		fprintf( stderr, "Typecheck -> %s\n",
			 tc ? tc->type->str : "<none>" );
#endif
		if( tc ) {
		    int newmemory = 0;
		    *ptr = SWIG_TypeCast(tc, source, &newmemory);
		    assert(!newmemory); /* newmemory handling not yet implemented */
		    return 0;
		} else
		    return -1;
	    }
	} else {
	    *ptr = source;
	    return 0;
	}
    }

/* Return 0 if successful. */
    SWIGINTERN int
    SWIG_GetPtr(void *inptr, void **outptr, 
		swig_type_info *intype, swig_type_info *outtype) {
	if (intype) {
	    return SWIG_Cast(inptr, intype,
			     outptr, outtype) == -1;
	} else {
	    *outptr = inptr;
	    return 0;
	}
    }

    SWIGINTERN void caml_print_list( CAML_VALUE v );

    SWIGINTERN void caml_print_val( CAML_VALUE v ) {
	switch( SWIG_Tag_val(v) ) {
	case C_bool:
	    if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " );
	    else fprintf( stderr, "false " );
	    break;
	case C_char:
	case C_uchar:
	    fprintf( stderr, "'%c' (\\%03d) ", 
		     (Int_val(SWIG_Field(v,0)) >= ' ' &&
		      Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.',
		     Int_val(SWIG_Field(v,0)) );
	    break;
	case C_short:
	case C_ushort:
	case C_int:
	    fprintf( stderr, "%d ", (int)caml_long_val(v) );
	    break;

	case C_uint:
	case C_int32:
	    fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) );
	    break;
	case C_int64:
	    fprintf( stderr, "%ld ", caml_long_val(v) );
	    break;
	case C_float:
	case C_double:
	    fprintf( stderr, "%f ", caml_double_val(v) );
	    break;

	case C_ptr:
	{
	    void *vout = 0;
	    swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
	    caml_ptr_val_internal(v,&vout,0);
	    fprintf( stderr, "PTR(%p,%s) ", 
		     vout,
		     ty ? ty->name : "(null)" );
	}
	break;
	case C_array:
	{
	    unsigned int i;
	    for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) 
		caml_print_val( SWIG_Field(SWIG_Field(v,0),i) );
	}
	break;
	case C_list:
	    caml_print_list( SWIG_Field(v,0) );
	    break;
	case C_obj:
	    fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) );
	    break;
	case C_string:
	{
	    void *cout;
	    caml_ptr_val_internal(v,&cout,0);
	    fprintf( stderr, "'%s' ", (char *)cout );
	} 
	break;
	}
    }

    SWIGINTERN void caml_print_list( CAML_VALUE v ) {
	CAMLparam1(v);
	while( v && Is_block(v) ) {
	    fprintf( stderr, "[ " );
	    caml_print_val( SWIG_Field(v,0) );
	    fprintf( stderr, "]\n" );
	    v = SWIG_Field(v,1);
	}
	CAMLreturn0;
    }

    SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) {
	CAMLparam1(lst);
	int i = 0;
	while( i < n && lst && Is_block(lst) ) {
	    i++; lst = SWIG_Field(lst,1);
	}
	if( lst == Val_unit ) CAMLreturn(Val_unit);
	else CAMLreturn(SWIG_Field(lst,0));
    }
    
    SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) {
	CAMLparam2(lst,elt);
	SWIG_CAMLlocal3(v,vt,lh);
	lh = Val_unit;
	v = Val_unit;

	/* Appending C_void should have no effect */
	if( !Is_block(elt) ) return lst;

	while( lst && Is_block(lst) ) {
	    if( v && v != Val_unit ) {
		vt = caml_alloc_tuple(2);
		SWIG_Store_field(v,1,vt);
		v = vt;
	    } else {
		v = lh = caml_alloc_tuple(2);
	    }
	    SWIG_Store_field(v,0,SWIG_Field(lst,0));
	    lst = SWIG_Field(lst,1);
	}

	if( v && Is_block(v) ) {
	    vt = caml_alloc_tuple(2);
	    SWIG_Store_field(v,1,vt);
	    v = vt;
	} else {
	    v = lh = caml_alloc_tuple(2);
	}
	SWIG_Store_field(v,0,elt);
	SWIG_Store_field(v,1,Val_unit);

	CAMLreturn(lh);
    }

    SWIGINTERN int caml_list_length( CAML_VALUE lst ) {
	CAMLparam1(lst);
	int i = 0;
	while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); }
	CAMLreturn(i);
    }

    SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) {
	CAMLparam2(arr,item);
	SWIG_Store_field(SWIG_Field(arr,0),n,item);
	CAMLreturn0;
    }

    SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) {
	CAMLparam1(arr);
	if( SWIG_Tag_val(arr) == C_array )
	    CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n));
	else if( SWIG_Tag_val(arr) == C_list )
	    CAMLreturn(caml_list_nth(arr,0));
	else
	    caml_failwith("Need array or list");
    }

    SWIGINTERN int caml_array_len( CAML_VALUE arr ) {
	CAMLparam1(arr);
	if( SWIG_Tag_val(arr) == C_array )
	    CAMLreturn(Wosize_val(SWIG_Field(arr,0)));
	else if( SWIG_Tag_val(arr) == C_list )
	    CAMLreturn(caml_list_length(arr));
	else
	    caml_failwith("Need array or list");
    }

    SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) {
	return caml_alloc(x,y);
    }

    SWIGINTERN value caml_array_new( int n ) {
	CAMLparam0();
	SWIG_CAMLlocal1(vv);
	vv = caml_swig_alloc(1,C_array);
	SWIG_Store_field(vv,0,caml_alloc_tuple(n));
	CAMLreturn(vv);
    }
    
    SWIGINTERN CAML_VALUE caml_val_bool( int b ) {
	CAMLparam0();
	SWIG_CAMLlocal1(bv);
	bv = caml_swig_alloc(1,C_bool);
	SWIG_Store_field(bv,0,Val_bool(b));
	CAMLreturn(bv);
    }

    SWIGINTERN CAML_VALUE caml_val_char( char c ) {
	CAMLparam0();
	SWIG_CAMLlocal1(cv);
	cv = caml_swig_alloc(1,C_char);
	SWIG_Store_field(cv,0,Val_int(c));
	CAMLreturn(cv);
    }

    SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) {
	CAMLparam0();
	SWIG_CAMLlocal1(ucv);
	ucv = caml_swig_alloc(1,C_uchar);
	SWIG_Store_field(ucv,0,Val_int(uc));
	CAMLreturn(ucv);
    }

    SWIGINTERN CAML_VALUE caml_val_short( short s ) {
	CAMLparam0();
	SWIG_CAMLlocal1(sv);
	sv = caml_swig_alloc(1,C_short);
	SWIG_Store_field(sv,0,Val_int(s));
	CAMLreturn(sv);
    }

    SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) {
	CAMLparam0();
	SWIG_CAMLlocal1(usv);
	usv = caml_swig_alloc(1,C_ushort);
	SWIG_Store_field(usv,0,Val_int(us));
	CAMLreturn(usv);
    }

    SWIGINTERN CAML_VALUE caml_val_int( int i ) {
	CAMLparam0();
	SWIG_CAMLlocal1(iv);
	iv = caml_swig_alloc(1,C_int);
	SWIG_Store_field(iv,0,Val_int(i));
	CAMLreturn(iv);
    }

    SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) {
	CAMLparam0();
	SWIG_CAMLlocal1(uiv);
	uiv = caml_swig_alloc(1,C_int);
	SWIG_Store_field(uiv,0,Val_int(ui));
	CAMLreturn(uiv);
    }

    SWIGINTERN CAML_VALUE caml_val_long( long l ) {
	CAMLparam0();
	SWIG_CAMLlocal1(lv);
	lv = caml_swig_alloc(1,C_int64);
	SWIG_Store_field(lv,0,caml_copy_int64(l));
	CAMLreturn(lv);
    }

    SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) {
	CAMLparam0();
	SWIG_CAMLlocal1(ulv);
	ulv = caml_swig_alloc(1,C_int64);
	SWIG_Store_field(ulv,0,caml_copy_int64(ul));
	CAMLreturn(ulv);
    }

    SWIGINTERN CAML_VALUE caml_val_float( float f ) {
	CAMLparam0();
	SWIG_CAMLlocal1(fv);
	fv = caml_swig_alloc(1,C_float);
	SWIG_Store_field(fv,0,caml_copy_double((double)f));
	CAMLreturn(fv);
    }

    SWIGINTERN CAML_VALUE caml_val_double( double d ) {
	CAMLparam0();
	SWIG_CAMLlocal1(fv);
	fv = caml_swig_alloc(1,C_double);
	SWIG_Store_field(fv,0,caml_copy_double(d));
	CAMLreturn(fv);
    }

    SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) {
	CAMLparam0();
	SWIG_CAMLlocal1(vv);
	vv = caml_swig_alloc(2,C_ptr);
	SWIG_Store_field(vv,0,caml_copy_int64((long)p));
	SWIG_Store_field(vv,1,caml_copy_int64((long)info));
	CAMLreturn(vv);
    }

    SWIGINTERN CAML_VALUE caml_val_string( const char *p ) {
	CAMLparam0();
	SWIG_CAMLlocal1(vv);
	if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
	vv = caml_swig_alloc(1,C_string);
	SWIG_Store_field(vv,0,caml_copy_string(p));
	CAMLreturn(vv);
    }

    SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) {
	CAMLparam0();
	SWIG_CAMLlocal1(vv);
	if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
	vv = caml_swig_alloc(1,C_string);
	SWIG_Store_field(vv,0,caml_alloc_string(len));
	memcpy(String_val(SWIG_Field(vv,0)),p,len);
	CAMLreturn(vv);
    }

    #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name)
    SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) {
	CAMLparam0();
	CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"),
			     caml_val_ptr(v,type),
			     caml_copy_string(name)));
    }

    SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) {
	CAMLparam1(v);
	if( !Is_block(v) ) return 0;

	switch( SWIG_Tag_val(v) ) {
	case C_bool:
	case C_char:
	case C_uchar:
	case C_short:
	case C_ushort:
	case C_int:
	    CAMLreturn(Int_val(SWIG_Field(v,0)));
	case C_uint:
	case C_int32:
	    CAMLreturn(Int32_val(SWIG_Field(v,0)));
	case C_int64:
	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0)));
	case C_float:
	case C_double:
	    CAMLreturn((long)Double_val(SWIG_Field(v,0)));
	case C_string:
	    CAMLreturn((long)String_val(SWIG_Field(v,0)));
	case C_ptr:
	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0)));
	case C_enum: {
	    SWIG_CAMLlocal1(ret);
	    const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int");
	    if( !name ) caml_failwith( "Not an enum conversion" );
	    ret = caml_callback2(*enum_to_int,*caml_named_value(name),v);
	    CAMLreturn(caml_long_val(ret));
	}
	default:
	    caml_failwith("No conversion to int");
	}
    }

    SWIGINTERN long caml_long_val( CAML_VALUE v ) {
	return caml_long_val_full(v,0);
    }

    SWIGINTERN double caml_double_val( CAML_VALUE v ) {
	CAMLparam1(v);
	if( !Is_block(v) ) return 0.0;
	switch( SWIG_Tag_val(v) ) {
	case C_bool:
	case C_char:
	case C_uchar:
	case C_short:
	case C_ushort:
	case C_int:
	    CAMLreturn_type(Int_val(SWIG_Field(v,0)));
	case C_uint:
	case C_int32:
	    CAMLreturn_type(Int32_val(SWIG_Field(v,0)));
	case C_int64:
	    CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0)));
	case C_float:
	case C_double:
	    CAMLreturn_type(Double_val(SWIG_Field(v,0)));
	default:
	    fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) );
	    caml_failwith("No conversion to double");
	}
    }

    SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out,
					  swig_type_info *descriptor ) {
	CAMLparam1(v);
	void *outptr = NULL;
        swig_type_info *outdescr = NULL;
        static const CAML_VALUE *func_val = NULL;

	if( v == Val_unit ) {
	    *out = 0;
	    CAMLreturn_type(0);
	}
	if( !Is_block(v) ) return -1;
	switch( SWIG_Tag_val(v) ) {
	case C_obj:
	    if (!func_val) {
	        func_val = caml_named_value("caml_obj_ptr");
	    }
	    CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor));
	case C_string:
	    outptr = (void *)String_val(SWIG_Field(v,0));
	    break;
	case C_ptr:
	    outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0));
            outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
	    break;
	default:
	    *out = 0;
	    CAMLreturn_type(1);
	    break;
	}

	CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor));
    }

    SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) {
        CAMLparam0();
#ifdef TYPE_CAST_VERBOSE
	caml_print_val( v );
#endif
	void *out = NULL;
	if( !caml_ptr_val_internal( v, &out, descriptor ) )
	    CAMLreturn_type(out);
	else
	    caml_failwith( "No appropriate conversion found." );
    }

    SWIGINTERN char *caml_string_val( CAML_VALUE v ) {
	return (char *)caml_ptr_val( v, 0 );
    }

    SWIGINTERN int caml_string_len( CAML_VALUE v ) {
	switch( SWIG_Tag_val(v) ) {
	case C_string:
	    return caml_string_length(SWIG_Field(v,0));
	default:
	    return strlen((char *)caml_ptr_val(v,0));
	}
    }

    SWIGINTERN int caml_bool_check( CAML_VALUE v ) {
	CAMLparam1(v);
	
	if( !Is_block(v) ) return 0;
	
	switch( SWIG_Tag_val(v) ) {
	case C_bool:
	case C_ptr:
	case C_string:
	    CAMLreturn(1);
	default:
	    CAMLreturn(0);
	}
    }

    SWIGINTERN int caml_int_check( CAML_VALUE v ) {
	CAMLparam1(v);
	
	if( !Is_block(v) ) return 0;
	
	switch( SWIG_Tag_val(v) ) {
	case C_char:
	case C_uchar:
	case C_short:
	case C_ushort:
	case C_int:
	case C_uint:
	case C_int32:
	case C_int64:
	    CAMLreturn(1);

	default:
	    CAMLreturn(0);
	}
    }

    SWIGINTERN int caml_float_check( CAML_VALUE v ) {
	CAMLparam1(v);
	if( !Is_block(v) ) return 0;

	switch( SWIG_Tag_val(v) ) {
	case C_float:
	case C_double:
	    CAMLreturn(1);

	default:
	    CAMLreturn(0);
	}	
    }

    SWIGINTERN int caml_ptr_check( CAML_VALUE v ) {
	CAMLparam1(v);
	if( !Is_block(v) ) return 0;

	switch( SWIG_Tag_val(v) ) {
	case C_string:
	case C_ptr:
	case C_int64:
	    CAMLreturn(1);

	default:
	    CAMLreturn(0);
	}	
    }

    SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) {
        CAMLparam0();
        SWIG_CAMLlocal1(result);

        const CAML_VALUE *fromval = caml_named_value(name);
        if (fromval) {
            result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor));
        } else {
            result = caml_val_ptr(ptr, descriptor);
        }
        CAMLreturn(result);
    }

    static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
      CAML_VALUE pointer;

      pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0));
      if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) {
        return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0));
      }
      return 0;
    }

    static void SWIG_Ocaml_SetModule(swig_module_info *pointer) {
      CAML_VALUE mod_pointer;

      mod_pointer = caml_val_ptr(pointer, NULL);
      caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer);
    }

#ifdef __cplusplus
}
#endif
#undef value


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




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

#define SWIGTYPE_p_Agedge_t swig_types[0]
#define SWIGTYPE_p_Agnode_t swig_types[1]
#define SWIGTYPE_p_Agraph_t swig_types[2]
#define SWIGTYPE_p_Agsym_t swig_types[3]
#define SWIGTYPE_p_FILE swig_types[4]
static swig_type_info *swig_types[6];
static swig_module_info swig_module = {swig_types, 5, 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) -------- */


SWIGINTERN void SWIG_OCamlException(int code, const char *msg) {
  CAMLparam0();

  SWIG_OCamlExceptionCodes exception_code = SWIG_OCamlUnknownError;
  switch (code) {
  case SWIG_DivisionByZero:
    exception_code = SWIG_OCamlArithmeticException;
    break;
  case SWIG_IndexError:
    exception_code = SWIG_OCamlIndexOutOfBoundsException;
    break;
  case SWIG_IOError:
  case SWIG_SystemError:
    exception_code = SWIG_OCamlSystemException;
    break;
  case SWIG_MemoryError:
    exception_code = SWIG_OCamlOutOfMemoryError;
    break;
  case SWIG_OverflowError:
    exception_code = SWIG_OCamlOverflowException;
    break;
  case SWIG_RuntimeError:
    exception_code = SWIG_OCamlRuntimeException;
    break;
  case SWIG_SyntaxError:
  case SWIG_TypeError:
  case SWIG_ValueError:
    exception_code = SWIG_OCamlIllegalArgumentException;
    break;
  case SWIG_UnknownError:
  default:
    exception_code = SWIG_OCamlUnknownError;
    break;
  }
  SWIG_OCamlThrowException(exception_code, msg);
  CAMLreturn0;
}
#define SWIG_exception(code, msg) SWIG_OCamlException(code, msg)


#include <typeinfo>
#include <stdexcept>


/* some language headers (e.g. php.h, ruby.h) leave these defined */
#undef PACKAGE_BUGREPORT
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_NAME

#ifdef SWIGOCAML
#include <stdint.h>
#endif

#include "config.h"
#include <gvc/gvc.h>

/** New graphs */
/*** New empty graph */
extern Agraph_t *graph(char *name);
extern Agraph_t *digraph(char *name);
extern Agraph_t *strictgraph(char *name);
extern Agraph_t *strictdigraph(char *name);
/*** New graph from a dot-syntax string or file */
extern Agraph_t *readstring(char *string);
extern Agraph_t *read(const char *filename);
extern Agraph_t *read(FILE *f);
/*** Add new subgraph to existing graph */
extern Agraph_t *graph(Agraph_t *g, char *name);

/** New nodes */
/*** Add new node to existing graph */
extern Agnode_t *node(Agraph_t *g, char *name);

/** New edges */
/*** Add new edge between existing nodes */
extern Agedge_t *edge(Agnode_t *t, Agnode_t *h);
/*** Add a new edge between an existing tail node, and a named head node which will be induced in the graph if it doesn't already exist */
extern Agedge_t *edge(Agnode_t *t, char *hname);
/*** Add a new edge between an existing head node, and a named tail node which will be induced in the graph if it doesn't already exist */
extern Agedge_t *edge(char *tname, Agnode_t *h);
/*** Add a new edge between named tail  and head nodes which will be induced in the graph if they don't already exist */
extern Agedge_t *edge(Agraph_t *g, char *tname, char *hname);

/** Setting attribute values */
/*** Set value of named attribute of graph/node/edge - creating attribute if necessary */
extern char *setv(Agraph_t *g, char *attr, char *val);
extern char *setv(Agnode_t *n, char *attr, char *val);
extern char *setv(Agedge_t *e, char *attr, char *val);

/*** Set value of existing attribute of graph/node/edge (using attribute handle) */
extern char *setv(Agraph_t *g, Agsym_t *a, char *val);
extern char *setv(Agnode_t *n, Agsym_t *a, char *val);
extern char *setv(Agedge_t *e, Agsym_t *a, char *val);

/** Getting attribute values */
/*** Get value of named attribute of graph/node/edge */
extern char *getv(Agraph_t *g, char *attr);
extern char *getv(Agnode_t *n, char *attr);
extern char *getv(Agedge_t *e, char *attr);

/*** Get value of attribute of graph/node/edge (using attribute handle) */
extern char *getv(Agraph_t *g, Agsym_t *a);
extern char *getv(Agnode_t *n, Agsym_t *a);
extern char *getv(Agedge_t *e, Agsym_t *a);

/** Obtain names from handles */
extern char *nameof(Agraph_t *g);
extern char *nameof(Agnode_t *n);
extern char *nameof(Agsym_t *a);

/** Find handles from names */
extern Agraph_t *findsubg(Agraph_t *g, char *name);
extern Agnode_t *findnode(Agraph_t *g, char *name);
extern Agedge_t *findedge(Agnode_t *t, Agnode_t *h);

/** */
extern Agsym_t *findattr(Agraph_t *g, char *name);
extern Agsym_t *findattr(Agnode_t *n, char *name);
extern Agsym_t *findattr(Agedge_t *e, char *name);

/** Misc graph navigators returning handles */
extern Agnode_t *headof(Agedge_t *e);
extern Agnode_t *tailof(Agedge_t *e);
extern Agraph_t *graphof(Agraph_t *g);
extern Agraph_t *graphof(Agedge_t *e);
extern Agraph_t *graphof(Agnode_t *n);
extern Agraph_t *rootof(Agraph_t *g);

/** Obtain handles of proto node/edge for setting default attribute values */
extern Agnode_t *protonode(Agraph_t *g);
extern Agedge_t *protoedge(Agraph_t *g);

/** Iterators */
/*** Iteration termination tests */
extern bool ok(Agraph_t *g);
extern bool ok(Agnode_t *n);
extern bool ok(Agedge_t *e);
extern bool ok(Agsym_t *a);

/*** Iterate over subgraphs of a graph */
extern Agraph_t *firstsubg(Agraph_t *g);
extern Agraph_t *nextsubg(Agraph_t *g, Agraph_t *sg);

/*** Iterate over supergraphs of a graph (obscure and rarely useful) */
extern Agraph_t *firstsupg(Agraph_t *g);
extern Agraph_t *nextsupg(Agraph_t *g, Agraph_t *sg);

/*** Iterate over edges of a graph */
extern Agedge_t *firstedge(Agraph_t *g);
extern Agedge_t *nextedge(Agraph_t *g, Agedge_t *e);

/*** Iterate over outedges of a graph */
extern Agedge_t *firstout(Agraph_t *g);
extern Agedge_t *nextout(Agraph_t *g, Agedge_t *e);

/*** Iterate over edges of a node */
extern Agedge_t *firstedge(Agnode_t *n);
extern Agedge_t *nextedge(Agnode_t *n, Agedge_t *e);

/*** Iterate over out-edges of a node */
extern Agedge_t *firstout(Agnode_t *n);
extern Agedge_t *nextout(Agnode_t *n, Agedge_t *e);

/*** Iterate over head nodes reachable from out-edges of a node */
extern Agnode_t *firsthead(Agnode_t *n);
extern Agnode_t *nexthead(Agnode_t *n, Agnode_t *h);

/*** Iterate over in-edges of a graph */
extern Agedge_t *firstin(Agraph_t *g);
extern Agedge_t *nextin(Agnode_t *n, Agedge_t *e);

/*** Iterate over in-edges of a node */
extern Agedge_t *firstin(Agnode_t *n);
extern Agedge_t *nextin(Agraph_t *g, Agedge_t *e);

/*** Iterate over tail nodes reachable from in-edges of a node */
extern Agnode_t *firsttail(Agnode_t *n);
extern Agnode_t *nexttail(Agnode_t *n, Agnode_t *t);

/*** Iterate over nodes of a graph */
extern Agnode_t *firstnode(Agraph_t *g);
extern Agnode_t *nextnode(Agraph_t *g, Agnode_t *n);

/*** Iterate over nodes of an edge */
extern Agnode_t *firstnode(Agedge_t *e);
extern Agnode_t *nextnode(Agedge_t *e, Agnode_t *n);

/*** Iterate over attributes of a graph */
extern Agsym_t *firstattr(Agraph_t *g);
extern Agsym_t *nextattr(Agraph_t *g, Agsym_t *a);

/*** Iterate over attributes of an edge */
extern Agsym_t *firstattr(Agedge_t *e);
extern Agsym_t *nextattr(Agedge_t *e, Agsym_t *a);

/*** Iterate over attributes of a node */
extern Agsym_t *firstattr(Agnode_t *n);
extern Agsym_t *nextattr(Agnode_t *n, Agsym_t *a);

/** Remove graph objects */
extern bool rm(Agraph_t *g);
extern bool rm(Agnode_t *n);
extern bool rm(Agedge_t *e);

/** Layout */
/*** Annotate a graph with layout attributes and values using a specific layout engine */
extern bool layout(Agraph_t *g, const char *engine);

/** Render */
/*** Render a layout into attributes of the graph */
extern bool render(Agraph_t *g); 
/*** Render a layout to stdout */
extern bool render(Agraph_t *g, const char *format);
/*** Render to an open file */
extern bool render(Agraph_t *g, const char *format, FILE *fout);
/*** Render a layout to an unopened file by name */
extern bool render(Agraph_t *g, const char *format, const char *filename);
/*** Render to a string result */
#ifdef SWIGJAVA
extern char* renderresult(Agraph_t *ing, const char *format);
#else
extern void renderresult(Agraph_t *g, const char *format, char *outdata);
/*** Render to an open channel */
extern bool renderchannel(Agraph_t *g, const char *format, const char *channelname);
/*** Render a layout to a malloc'ed string, to be free'd by the caller */
/*** (deprecated - too easy to leak memory) */
/*** (still needed for "eval [gv::renderdata $G tk]" ) */
#endif
extern char* renderdata(Agraph_t *g, const char *format);

/*** Writing graph back to file */
extern bool write(Agraph_t *g, const char *filename);
extern bool write(Agraph_t *g, FILE *f);

/*** Graph transformation tools */
extern bool tred(Agraph_t *g);


SWIGEXT CAML_VALUE _wrap_graph__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)graph(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_digraphgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'digraph'");
  }
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)digraph(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_strictgraphgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'strictgraph'");
  }
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)strictgraph(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_strictdigraphgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'strictdigraph'");
  }
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)strictdigraph(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_readstringgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'readstring'");
  }
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)readstring(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_read__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  result = (Agraph_t *)read((char const *)arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_read__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  FILE *arg1 = (FILE *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (FILE *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_FILE);
  }
  result = (Agraph_t *)read(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_readgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_FILE);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_read__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if( !Is_block(argv[0]) ) _v = 0;
      else {
        switch( SWIG_Tag_val(argv[0]) ) {
          case C_string: _v = 1; break;
          case C_ptr: {
            swig_type_info *typeinfo = 
            (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[0],1));
            _v = SWIG_TypeCheck("char *",typeinfo) ||
            SWIG_TypeCheck("signed char *",typeinfo) ||
            SWIG_TypeCheck("unsigned char *",typeinfo) ||
            SWIG_TypeCheck("const char *",typeinfo) ||
            SWIG_TypeCheck("const signed char *",typeinfo) ||
            SWIG_TypeCheck("const unsigned char *",typeinfo) ||
            SWIG_TypeCheck("std::string",typeinfo);
          } break;
          default: _v = 0; break;
        }
      }    
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_read__SWIG_0gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'read'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    read(char const *)\n"
    "    read(FILE *)\n");
}


SWIGEXT CAML_VALUE _wrap_graph__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agraph_t *)graph(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_graphgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if( !Is_block(argv[0]) ) _v = 0;
      else {
        switch( SWIG_Tag_val(argv[0]) ) {
          case C_string: _v = 1; break;
          case C_ptr: {
            swig_type_info *typeinfo = 
            (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[0],1));
            _v = SWIG_TypeCheck("char *",typeinfo) ||
            SWIG_TypeCheck("signed char *",typeinfo) ||
            SWIG_TypeCheck("unsigned char *",typeinfo) ||
            SWIG_TypeCheck("const char *",typeinfo) ||
            SWIG_TypeCheck("const signed char *",typeinfo) ||
            SWIG_TypeCheck("const unsigned char *",typeinfo) ||
            SWIG_TypeCheck("std::string",typeinfo);
          } break;
          default: _v = 0; break;
        }
      }    
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_graph__SWIG_0gv(args));
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_graph__SWIG_1gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'graph'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    graph(char *)\n"
    "    graph(Agraph_t *,char *)\n");
}


SWIGEXT CAML_VALUE _wrap_nodegv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'node'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agnode_t *)node(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_edge__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)edge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_edge__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agedge_t *)edge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_edge__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  char *arg1 = (char *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (char *)caml_string_val(caml_list_nth(args,0));
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)edge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_edge__SWIG_3gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (Agedge_t *)edge(arg1,arg2,arg3);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_edgegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agnode_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_edge__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_edge__SWIG_1gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if( !Is_block(argv[0]) ) _v = 0;
      else {
        switch( SWIG_Tag_val(argv[0]) ) {
          case C_string: _v = 1; break;
          case C_ptr: {
            swig_type_info *typeinfo = 
            (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[0],1));
            _v = SWIG_TypeCheck("char *",typeinfo) ||
            SWIG_TypeCheck("signed char *",typeinfo) ||
            SWIG_TypeCheck("unsigned char *",typeinfo) ||
            SWIG_TypeCheck("const char *",typeinfo) ||
            SWIG_TypeCheck("const signed char *",typeinfo) ||
            SWIG_TypeCheck("const unsigned char *",typeinfo) ||
            SWIG_TypeCheck("std::string",typeinfo);
          } break;
          default: _v = 0; break;
        }
      }    
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agnode_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_edge__SWIG_2gv(args));
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_edge__SWIG_3gv(args));
        }
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'edge'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    edge(Agnode_t *,Agnode_t *)\n"
    "    edge(Agnode_t *,char *)\n"
    "    edge(char *,Agnode_t *)\n"
    "    edge(Agraph_t *,char *,char *)\n");
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_3gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_4gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setv__SWIG_5gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *arg3 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (char *)setv(arg1,arg2,arg3);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_setvgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_3gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_4gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_5gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_0gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_1gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_setv__SWIG_2gv(args));
        }
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'setv'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    setv(Agraph_t *,char *,char *)\n"
    "    setv(Agnode_t *,char *,char *)\n"
    "    setv(Agedge_t *,char *,char *)\n"
    "    setv(Agraph_t *,Agsym_t *,char *)\n"
    "    setv(Agnode_t *,Agsym_t *,char *)\n"
    "    setv(Agedge_t *,Agsym_t *,char *)\n");
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_3gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_4gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getv__SWIG_5gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (char *)getv(arg1,arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_getvgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_3gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_4gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_5gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_1gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_getv__SWIG_2gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'getv'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    getv(Agraph_t *,char *)\n"
    "    getv(Agnode_t *,char *)\n"
    "    getv(Agedge_t *,char *)\n"
    "    getv(Agraph_t *,Agsym_t *)\n"
    "    getv(Agnode_t *,Agsym_t *)\n"
    "    getv(Agedge_t *,Agsym_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nameof__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (char *)nameof(arg1);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nameof__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (char *)nameof(arg1);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nameof__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agsym_t *arg1 = (Agsym_t *) 0 ;
  char *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agsym_t);
  }
  result = (char *)nameof(arg1);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nameofgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_nameof__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_nameof__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agsym_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_nameof__SWIG_2gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nameof'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nameof(Agraph_t *)\n"
    "    nameof(Agnode_t *)\n"
    "    nameof(Agsym_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_findsubggv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'findsubg'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agraph_t *)findsubg(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findnodegv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'findnode'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agnode_t *)findnode(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findedgegv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'findedge'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)findedge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findattr__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agsym_t *)findattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findattr__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agsym_t *)findattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findattr__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  char *arg2 = (char *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (Agsym_t *)findattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_findattrgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_findattr__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_findattr__SWIG_1gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_findattr__SWIG_2gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'findattr'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    findattr(Agraph_t *,char *)\n"
    "    findattr(Agnode_t *,char *)\n"
    "    findattr(Agedge_t *,char *)\n");
}


SWIGEXT CAML_VALUE _wrap_headofgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'headof'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (Agnode_t *)headof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_tailofgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'tailof'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (Agnode_t *)tailof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_graphof__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)graphof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_graphof__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (Agraph_t *)graphof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_graphof__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agraph_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agraph_t *)graphof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_graphofgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_graphof__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_graphof__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_graphof__SWIG_2gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'graphof'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    graphof(Agraph_t *)\n"
    "    graphof(Agedge_t *)\n"
    "    graphof(Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_rootofgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'rootof'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)rootof(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_protonodegv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'protonode'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agnode_t *)protonode(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_protoedgegv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'protoedge'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agedge_t *)protoedge(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_ok__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (bool)ok(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_ok__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (bool)ok(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_ok__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (bool)ok(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_ok__SWIG_3gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agsym_t *arg1 = (Agsym_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agsym_t);
  }
  result = (bool)ok(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_okgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_ok__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_ok__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_ok__SWIG_2gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agsym_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_ok__SWIG_3gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'ok'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    ok(Agraph_t *)\n"
    "    ok(Agnode_t *)\n"
    "    ok(Agedge_t *)\n"
    "    ok(Agsym_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_firstsubggv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'firstsubg'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)firstsubg(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextsubggv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *arg2 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'nextsubg'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)nextsubg(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstsupggv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'firstsupg'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)firstsupg(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextsupggv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agraph_t *arg2 = (Agraph_t *) 0 ;
  Agraph_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'nextsupg'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agraph_t);
  }
  result = (Agraph_t *)nextsupg(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agraph_t_from_ptr", (void *)result, SWIGTYPE_p_Agraph_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstedge__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agedge_t *)firstedge(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextedge__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextedge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstout__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agedge_t *)firstout(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextout__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextout(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstedge__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)firstedge(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstedgegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstedge__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstedge__SWIG_1gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'firstedge'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    firstedge(Agraph_t *)\n"
    "    firstedge(Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nextedge__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextedge(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextedgegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextedge__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextedge__SWIG_1gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nextedge'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nextedge(Agraph_t *,Agedge_t *)\n"
    "    nextedge(Agnode_t *,Agedge_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_firstout__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)firstout(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstoutgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstout__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstout__SWIG_1gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'firstout'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    firstout(Agraph_t *)\n"
    "    firstout(Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nextout__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextout(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextoutgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextout__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextout__SWIG_1gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nextout'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nextout(Agraph_t *,Agedge_t *)\n"
    "    nextout(Agnode_t *,Agedge_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_firstheadgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'firsthead'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)firsthead(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextheadgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'nexthead'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)nexthead(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstin__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agedge_t *)firstin(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextin__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextin(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstin__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agedge_t *)firstin(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstingv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstin__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstin__SWIG_1gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'firstin'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    firstin(Agraph_t *)\n"
    "    firstin(Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nextin__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agedge_t *arg2 = (Agedge_t *) 0 ;
  Agedge_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agedge_t);
  }
  result = (Agedge_t *)nextin(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agedge_t_from_ptr", (void *)result, SWIGTYPE_p_Agedge_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextingv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextin__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agedge_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextin__SWIG_1gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nextin'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nextin(Agnode_t *,Agedge_t *)\n"
    "    nextin(Agraph_t *,Agedge_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_firsttailgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'firsttail'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)firsttail(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nexttailgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'nexttail'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)nexttail(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstnode__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agnode_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agnode_t *)firstnode(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextnode__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)nextnode(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstnode__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agnode_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (Agnode_t *)firstnode(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstnodegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstnode__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstnode__SWIG_1gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'firstnode'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    firstnode(Agraph_t *)\n"
    "    firstnode(Agedge_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nextnode__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agnode_t *arg2 = (Agnode_t *) 0 ;
  Agnode_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agnode_t);
  }
  result = (Agnode_t *)nextnode(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agnode_t_from_ptr", (void *)result, SWIGTYPE_p_Agnode_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextnodegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agnode_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextnode__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agnode_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextnode__SWIG_1gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nextnode'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nextnode(Agraph_t *,Agnode_t *)\n"
    "    nextnode(Agedge_t *,Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_firstattr__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (Agsym_t *)firstattr(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextattr__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (Agsym_t *)nextattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstattr__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (Agsym_t *)firstattr(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextattr__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (Agsym_t *)nextattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstattr__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (Agsym_t *)firstattr(arg1);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_firstattrgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstattr__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstattr__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_firstattr__SWIG_2gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'firstattr'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    firstattr(Agraph_t *)\n"
    "    firstattr(Agedge_t *)\n"
    "    firstattr(Agnode_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_nextattr__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  Agsym_t *arg2 = (Agsym_t *) 0 ;
  Agsym_t *result = 0 ;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  {
    arg2 = (Agsym_t *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_Agsym_t);
  }
  result = (Agsym_t *)nextattr(arg1,arg2);
  {
    rv = SWIG_Ocaml_ptr_to_val("create_Agsym_t_from_ptr", (void *)result, SWIGTYPE_p_Agsym_t);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_nextattrgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextattr__SWIG_0gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextattr__SWIG_1gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_Agsym_t);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_nextattr__SWIG_2gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'nextattr'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    nextattr(Agraph_t *,Agsym_t *)\n"
    "    nextattr(Agedge_t *,Agsym_t *)\n"
    "    nextattr(Agnode_t *,Agsym_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_rm__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (bool)rm(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_rm__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agnode_t *arg1 = (Agnode_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agnode_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agnode_t);
  }
  result = (bool)rm(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_rm__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agedge_t *arg1 = (Agedge_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agedge_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agedge_t);
  }
  result = (bool)rm(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_rmgv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_rm__SWIG_0gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agnode_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_rm__SWIG_1gv(args));
    }
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agedge_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_rm__SWIG_2gv(args));
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'rm'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    rm(Agraph_t *)\n"
    "    rm(Agnode_t *)\n"
    "    rm(Agedge_t *)\n");
}


SWIGEXT CAML_VALUE _wrap_layoutgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  bool result;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'layout'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (bool)layout(arg1,(char const *)arg2);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_render__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (bool)render(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_render__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (bool)render(arg1,(char const *)arg2);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_render__SWIG_2gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  FILE *arg3 = (FILE *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (FILE *)caml_ptr_val(caml_list_nth(args,2),SWIGTYPE_p_FILE);
  }
  result = (bool)render(arg1,(char const *)arg2,arg3);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_render__SWIG_3gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (bool)render(arg1,(char const *)arg2,(char const *)arg3);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_rendergv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 1) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      free(argv);
      CAMLreturn(_wrap_render__SWIG_0gv(args));
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_render__SWIG_1gv(args));
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if (!Is_block(argv[2]) || !(SWIG_Tag_val(argv[2]) == C_obj || SWIG_Tag_val(argv[2]) == C_ptr)) {
            _v = 0;
          } else {
            void *ptr;
            _v = !caml_ptr_val_internal(argv[2], &ptr, SWIGTYPE_p_FILE);
          }
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_render__SWIG_2gv(args));
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        {
          if( !Is_block(argv[2]) ) _v = 0;
          else {
            switch( SWIG_Tag_val(argv[2]) ) {
              case C_string: _v = 1; break;
              case C_ptr: {
                swig_type_info *typeinfo = 
                (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[2],1));
                _v = SWIG_TypeCheck("char *",typeinfo) ||
                SWIG_TypeCheck("signed char *",typeinfo) ||
                SWIG_TypeCheck("unsigned char *",typeinfo) ||
                SWIG_TypeCheck("const char *",typeinfo) ||
                SWIG_TypeCheck("const signed char *",typeinfo) ||
                SWIG_TypeCheck("const unsigned char *",typeinfo) ||
                SWIG_TypeCheck("std::string",typeinfo);
              } break;
              default: _v = 0; break;
            }
          }    
        }
        if (_v) {
          free(argv);
          CAMLreturn(_wrap_render__SWIG_3gv(args));
        }
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'render'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    render(Agraph_t *)\n"
    "    render(Agraph_t *,char const *)\n"
    "    render(Agraph_t *,char const *,FILE *)\n"
    "    render(Agraph_t *,char const *,char const *)\n");
}


SWIGEXT CAML_VALUE _wrap_renderresultgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  
  if (caml_list_length(args) < 3 || caml_list_length(args) > 3) {
    caml_invalid_argument("Incorrect number of arguments passed to 'renderresult'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  renderresult(arg1,(char const *)arg2,arg3);
  rv = Val_unit;
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_renderchannelgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  bool result;
  
  if (caml_list_length(args) < 3 || caml_list_length(args) > 3) {
    caml_invalid_argument("Incorrect number of arguments passed to 'renderchannel'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  {
    arg3 = (char *)caml_string_val(caml_list_nth(args,2));
  }
  result = (bool)renderchannel(arg1,(char const *)arg2,(char const *)arg3);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_renderdatagv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  char *result = 0 ;
  
  if (caml_list_length(args) < 2 || caml_list_length(args) > 2) {
    caml_invalid_argument("Incorrect number of arguments passed to 'renderdata'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (char *)renderdata(arg1,(char const *)arg2);
  {
    rv = caml_val_string((char *)result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_write__SWIG_0gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  char *arg2 = (char *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (char *)caml_string_val(caml_list_nth(args,1));
  }
  result = (bool)write(arg1,(char const *)arg2);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_write__SWIG_1gv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  FILE *arg2 = (FILE *) 0 ;
  bool result;
  
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  {
    arg2 = (FILE *)caml_ptr_val(caml_list_nth(args,1),SWIGTYPE_p_FILE);
  }
  result = (bool)write(arg1,arg2);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}


SWIGEXT CAML_VALUE _wrap_writegv(CAML_VALUE args) {
  CAMLparam1(args);
  int i;
  int argc = caml_list_length(args);
  
  CAML_VALUE *argv;
  
  argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );
  for( i = 0; i < argc; i++ ) {
    argv[i] = caml_list_nth(args,i);
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if (!Is_block(argv[1]) || !(SWIG_Tag_val(argv[1]) == C_obj || SWIG_Tag_val(argv[1]) == C_ptr)) {
          _v = 0;
        } else {
          void *ptr;
          _v = !caml_ptr_val_internal(argv[1], &ptr, SWIGTYPE_p_FILE);
        }
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_write__SWIG_1gv(args));
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      if (!Is_block(argv[0]) || !(SWIG_Tag_val(argv[0]) == C_obj || SWIG_Tag_val(argv[0]) == C_ptr)) {
        _v = 0;
      } else {
        void *ptr;
        _v = !caml_ptr_val_internal(argv[0], &ptr, SWIGTYPE_p_Agraph_t);
      }
    }
    if (_v) {
      {
        if( !Is_block(argv[1]) ) _v = 0;
        else {
          switch( SWIG_Tag_val(argv[1]) ) {
            case C_string: _v = 1; break;
            case C_ptr: {
              swig_type_info *typeinfo = 
              (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(argv[1],1));
              _v = SWIG_TypeCheck("char *",typeinfo) ||
              SWIG_TypeCheck("signed char *",typeinfo) ||
              SWIG_TypeCheck("unsigned char *",typeinfo) ||
              SWIG_TypeCheck("const char *",typeinfo) ||
              SWIG_TypeCheck("const signed char *",typeinfo) ||
              SWIG_TypeCheck("const unsigned char *",typeinfo) ||
              SWIG_TypeCheck("std::string",typeinfo);
            } break;
            default: _v = 0; break;
          }
        }    
      }
      if (_v) {
        free(argv);
        CAMLreturn(_wrap_write__SWIG_0gv(args));
      }
    }
  }
  
  free(argv);
  caml_failwith("Wrong number or type of arguments for overloaded function 'write'.\n"
    "  Possible C/C++ prototypes are:\n"
    "    write(Agraph_t *,char const *)\n"
    "    write(Agraph_t *,FILE *)\n");
}


SWIGEXT CAML_VALUE _wrap_tredgv (CAML_VALUE args)
{
  CAMLparam1(args);
  SWIG_CAMLlocal2(swig_result,rv);
  Agraph_t *arg1 = (Agraph_t *) 0 ;
  bool result;
  
  if (caml_list_length(args) < 1 || caml_list_length(args) > 1) {
    caml_invalid_argument("Incorrect number of arguments passed to 'tred'");
  }
  swig_result = Val_unit;
  {
    arg1 = (Agraph_t *)caml_ptr_val(caml_list_nth(args,0),SWIGTYPE_p_Agraph_t);
  }
  result = (bool)tred(arg1);
  {
    rv = caml_val_bool(result);
  }
  swig_result = caml_list_append(swig_result,rv);
  CAMLreturn(swig_result);
}



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

static swig_type_info _swigt__p_Agedge_t = {"_p_Agedge_t", "Agedge_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Agnode_t = {"_p_Agnode_t", "Agnode_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Agraph_t = {"_p_Agraph_t", "Agraph_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Agsym_t = {"_p_Agsym_t", "Agsym_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_Agedge_t,
  &_swigt__p_Agnode_t,
  &_swigt__p_Agraph_t,
  &_swigt__p_Agsym_t,
  &_swigt__p_FILE,
};

static swig_cast_info _swigc__p_Agedge_t[] = {  {&_swigt__p_Agedge_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Agnode_t[] = {  {&_swigt__p_Agnode_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Agraph_t[] = {  {&_swigt__p_Agraph_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Agsym_t[] = {  {&_swigt__p_Agsym_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_FILE[] = {  {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_Agedge_t,
  _swigc__p_Agnode_t,
  _swigc__p_Agraph_t,
  _swigc__p_Agsym_t,
  _swigc__p_FILE,
};


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

#define SWIG_init f_gv_init
/* -----------------------------------------------------------------------------
 * 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 %lu\n", (unsigned long)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 %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
#endif
    
    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
        type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }
    
    /* Insert casting types */
    cast = 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 %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
    printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  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

SWIGEXT void SWIG_init() {
  SWIG_InitializeModule(0);
  
}

