/* This file was generated by PyBindGen 0.15.0 */
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stddef.h>


#if PY_VERSION_HEX < 0x020400F0

#define PyEval_ThreadsInitialized() 1

#define Py_CLEAR(op)				\
        do {                            	\
                if (op) {			\
                        PyObject *tmp = (PyObject *)(op);	\
                        (op) = NULL;		\
                        Py_DECREF(tmp);		\
                }				\
        } while (0)


#define Py_VISIT(op)							\
        do { 								\
                if (op) {						\
                        int vret = visit((PyObject *)(op), arg);	\
                        if (vret)					\
                                return vret;				\
                }							\
        } while (0)

#endif



#if PY_VERSION_HEX < 0x020500F0

typedef int Py_ssize_t;
# define PY_SSIZE_T_MAX INT_MAX
# define PY_SSIZE_T_MIN INT_MIN
typedef inquiry lenfunc;
typedef intargfunc ssizeargfunc;
typedef intobjargproc ssizeobjargproc;

#endif


#if     __GNUC__ > 2
# define PYBINDGEN_UNUSED(param) param __attribute__((__unused__))
#elif     __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
# define PYBINDGEN_UNUSED(param) __attribute__((__unused__)) param
#else
# define PYBINDGEN_UNUSED(param) param
#endif  /* !__GNUC__ */

typedef enum _PyBindGenWrapperFlags {
   PYBINDGEN_WRAPPER_FLAG_NONE = 0,
   PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED = (1<<0),
} PyBindGenWrapperFlags;


#include "c.h"
void _wrap_Visit(int value, void *data);
/* --- module functions --- */


PyObject *
_wrap_cvisit(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
{
    PyObject *py_retval;
    PyObject *visitor;
    const char *keywords[] = {"visitor", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &visitor)) {
        return NULL;
    }
    if (!PyCallable_Check(visitor)) {
        PyErr_SetString(PyExc_TypeError, "visitor parameter must be callable");
        return NULL;
    }
    Py_INCREF(visitor);
    visit(_wrap_Visit, visitor);
    Py_INCREF(Py_None);
    py_retval = Py_None;
    Py_DECREF(visitor);
    return py_retval;
}
PyObject * _wrap_cvisit(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);

static PyMethodDef c_functions[] = {
    {(char *) "visit", (PyCFunction) _wrap_cvisit, METH_KEYWORDS|METH_VARARGS, NULL },
    {NULL, NULL, 0, NULL}
};

void _wrap_Visit(int value, void *data)
{
    PyObject *callback = (PyObject*) data;
    PyObject_CallFunction(callback, (char*) "i", value);
}



PyMODINIT_FUNC
#if defined(__GNUC__) && __GNUC__ >= 4
__attribute__ ((visibility("default")))
#endif
initc(void)
{
    PyObject *m;
    m = Py_InitModule3((char *) "c", c_functions, NULL);
    if (m == NULL) {
        return;
    }
}
