wiringpy2_wrap generated with newer SWIG

Conflicts:
	wiringpi2.pyc
pull/24/head
nalajcie 10 years ago
parent ad9df28b8b
commit 3455196b94

@ -1,11 +1,13 @@
# This file was automatically generated by SWIG (http://www.swig.org). # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.7 # Version 2.0.12
# #
# Do not make changes to this file unless you know what you are doing--modify # Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead. # the SWIG interface file instead.
from sys import version_info from sys import version_info
if version_info >= (2,6,0): if version_info >= (2,6,0):
def swig_import_helper(): def swig_import_helper():

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.7 * Version 2.0.12
* *
* This file is not intended to be easily readable and contains a number of * 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 * coding conventions designed to improve portability and efficiency. Do not make
@ -122,8 +122,14 @@
/* Python.h has to appear first */ #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG
# include <Python.h> # include <Python.h>
# define _DEBUG
#else
# include <Python.h>
#endif
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* swigrun.swg * swigrun.swg
@ -295,7 +301,7 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
} }
#else /* no cast-rank mode */ #else /* no cast-rank mode */
# define SWIG_AddCast # define SWIG_AddCast(r) (r)
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif #endif
@ -359,18 +365,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
/* /*
Check type equivalence in a name list like <name1>|<name2>|... Check type equivalence in a name list like <name1>|<name2>|...
Return 0 if not equal, 1 if equal Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/ */
SWIGRUNTIME int SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) { SWIG_TypeCmp(const char *nb, const char *tb) {
int equiv = 0; int equiv = 1;
const char* te = tb + strlen(tb); const char* te = tb + strlen(tb);
const char* ne = nb; const char* ne = nb;
while (!equiv && *ne) { while (equiv != 0 && *ne) {
for (nb = ne; *ne; ++ne) { for (nb = ne; *ne; ++ne) {
if (*ne == '|') break; if (*ne == '|') break;
} }
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; equiv = SWIG_TypeNameComp(nb, ne, tb, te);
if (*ne) ++ne; if (*ne) ++ne;
} }
return equiv; return equiv;
@ -378,24 +384,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
/* /*
Check type equivalence in a name list like <name1>|<name2>|... Check type equivalence in a name list like <name1>|<name2>|...
Return 0 if equal, -1 if nb < tb, 1 if nb > tb Return 0 if not equal, 1 if equal
*/ */
SWIGRUNTIME int SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) { SWIG_TypeEquiv(const char *nb, const char *tb) {
int equiv = 0; return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (!equiv && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
if (*ne) ++ne;
}
return equiv;
} }
/* /*
Check the typename Check the typename
*/ */
@ -903,6 +898,10 @@ static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
} }
#endif #endif
#if PY_VERSION_HEX < 0x02050000
#define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
#endif
#if PY_VERSION_HEX < 0x02040000 #if PY_VERSION_HEX < 0x02040000
#define Py_VISIT(op) \ #define Py_VISIT(op) \
do { \ do { \
@ -1174,7 +1173,7 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self),
/* Runtime API */ /* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
@ -1577,34 +1576,6 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
return repr; return repr;
} }
SWIGRUNTIME int
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
char *str;
#ifdef METH_NOARGS
PyObject *repr = SwigPyObject_repr(v);
#else
PyObject *repr = SwigPyObject_repr(v, NULL);
#endif
if (repr) {
str = SWIG_Python_str_AsChar(repr);
fputs(str, fp);
SWIG_Python_str_DelForPy3(str);
Py_DECREF(repr);
return 0;
} else {
return 1;
}
}
SWIGRUNTIME PyObject *
SwigPyObject_str(SwigPyObject *v)
{
char result[SWIG_BUFFER_SIZE];
return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
SWIG_Python_str_FromChar(result) : 0;
}
SWIGRUNTIME int SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
{ {
@ -1797,7 +1768,7 @@ SwigPyObject_own(PyObject *v, PyObject *args)
static PyMethodDef static PyMethodDef
swigobject_methods[] = { swigobject_methods[] = {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
@ -1890,7 +1861,7 @@ SwigPyObject_TypeOnce(void) {
sizeof(SwigPyObject), /* tp_basicsize */ sizeof(SwigPyObject), /* tp_basicsize */
0, /* tp_itemsize */ 0, /* tp_itemsize */
(destructor)SwigPyObject_dealloc, /* tp_dealloc */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */
(printfunc)SwigPyObject_print, /* tp_print */ 0, /* tp_print */
#if PY_VERSION_HEX < 0x02020000 #if PY_VERSION_HEX < 0x02020000
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */ (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
#else #else
@ -1908,7 +1879,7 @@ SwigPyObject_TypeOnce(void) {
0, /* tp_as_mapping */ 0, /* tp_as_mapping */
(hashfunc)0, /* tp_hash */ (hashfunc)0, /* tp_hash */
(ternaryfunc)0, /* tp_call */ (ternaryfunc)0, /* tp_call */
(reprfunc)SwigPyObject_str, /* tp_str */ 0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */ PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */ 0, /* tp_setattro */
0, /* tp_as_buffer */ 0, /* tp_as_buffer */
@ -2285,10 +2256,11 @@ SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
int res; int res;
SwigPyObject *sobj; SwigPyObject *sobj;
int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
if (!obj) if (!obj)
return SWIG_ERROR; return SWIG_ERROR;
if (obj == Py_None) { if (obj == Py_None && !implicit_conv) {
if (ptr) if (ptr)
*ptr = 0; *ptr = 0;
return SWIG_OK; return SWIG_OK;
@ -2337,7 +2309,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
} }
res = SWIG_OK; res = SWIG_OK;
} else { } else {
if (flags & SWIG_POINTER_IMPLICIT_CONV) { if (implicit_conv) {
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
if (data && !data->implicitconv) { if (data && !data->implicitconv) {
PyObject *klass = data->klass; PyObject *klass = data->klass;
@ -2372,6 +2344,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
} }
} }
} }
if (!SWIG_IsOK(res) && obj == Py_None) {
if (ptr)
*ptr = 0;
if (PyErr_Occurred())
PyErr_Clear();
res = SWIG_OK;
}
} }
return res; return res;
} }
@ -2460,23 +2439,29 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
} else { } else {
#if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03000000
inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
if (inst) {
PyObject_SetAttr(inst, SWIG_This(), swig_this); PyObject_SetAttr(inst, SWIG_This(), swig_this);
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
}
#else #else
PyObject *dict = PyDict_New(); PyObject *dict = PyDict_New();
if (dict) {
PyDict_SetItem(dict, SWIG_This(), swig_this); PyDict_SetItem(dict, SWIG_This(), swig_this);
inst = PyInstance_NewRaw(data->newargs, dict); inst = PyInstance_NewRaw(data->newargs, dict);
Py_DECREF(dict); Py_DECREF(dict);
}
#endif #endif
} }
return inst; return inst;
#else #else
#if (PY_VERSION_HEX >= 0x02010000) #if (PY_VERSION_HEX >= 0x02010000)
PyObject *inst; PyObject *inst = 0;
PyObject *dict = PyDict_New(); PyObject *dict = PyDict_New();
if (dict) {
PyDict_SetItem(dict, SWIG_This(), swig_this); PyDict_SetItem(dict, SWIG_This(), swig_this);
inst = PyInstance_NewRaw(data->newargs, dict); inst = PyInstance_NewRaw(data->newargs, dict);
Py_DECREF(dict); Py_DECREF(dict);
}
return (PyObject *) inst; return (PyObject *) inst;
#else #else
PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
@ -2583,13 +2568,11 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f
assert(!(flags & SWIG_BUILTIN_TP_INIT)); assert(!(flags & SWIG_BUILTIN_TP_INIT));
robj = SwigPyObject_New(ptr, type, own); robj = SwigPyObject_New(ptr, type, own);
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
if (inst) {
Py_DECREF(robj); Py_DECREF(robj);
robj = inst; robj = inst;
} }
}
return robj; return robj;
} }
@ -2609,7 +2592,7 @@ void *SWIG_ReturnGlobalTypeList(void *);
#endif #endif
SWIGRUNTIME swig_module_info * SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void) { SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
static void *type_pointer = (void *)0; static void *type_pointer = (void *)0;
/* first check if module already created */ /* first check if module already created */
if (!type_pointer) { if (!type_pointer) {
@ -2735,7 +2718,7 @@ SWIG_Python_TypeQuery(const char *type)
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
#endif #endif
} else { } else {
swig_module_info *swig_module = SWIG_Python_GetModule(); swig_module_info *swig_module = SWIG_GetModule(0);
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
if (descriptor) { if (descriptor) {
#ifdef SWIGPY_USE_CAPSULE #ifdef SWIGPY_USE_CAPSULE
@ -2867,7 +2850,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
PyObject *descr; PyObject *descr;
PyObject *encoded_name; PyObject *encoded_name;
descrsetfunc f; descrsetfunc f;
int res; int res = -1;
# ifdef Py_USING_UNICODE # ifdef Py_USING_UNICODE
if (PyString_Check(name)) { if (PyString_Check(name)) {
@ -2890,7 +2873,6 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
goto done; goto done;
} }
res = -1;
descr = _PyType_Lookup(tp, name); descr = _PyType_Lookup(tp, name);
f = NULL; f = NULL;
if (descr != NULL) if (descr != NULL)
@ -2959,7 +2941,7 @@ static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
#endif #endif
#define SWIG_name "_wiringpi2" #define SWIG_name "_wiringpi2"
#define SWIGVERSION 0x020007 #define SWIGVERSION 0x020012
#define SWIG_VERSION SWIGVERSION #define SWIG_VERSION SWIGVERSION
@ -3431,6 +3413,7 @@ SWIGINTERNINLINE PyObject*
SWIGINTERN int SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
{ {
#if PY_VERSION_HEX < 0x03000000
if (PyInt_Check(obj)) { if (PyInt_Check(obj)) {
long v = PyInt_AsLong(obj); long v = PyInt_AsLong(obj);
if (v >= 0) { if (v >= 0) {
@ -3439,13 +3422,27 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
} else { } else {
return SWIG_OverflowError; return SWIG_OverflowError;
} }
} else if (PyLong_Check(obj)) { } else
#endif
if (PyLong_Check(obj)) {
unsigned long v = PyLong_AsUnsignedLong(obj); unsigned long v = PyLong_AsUnsignedLong(obj);
if (!PyErr_Occurred()) { if (!PyErr_Occurred()) {
if (val) *val = v; if (val) *val = v;
return SWIG_OK; return SWIG_OK;
} else { } else {
PyErr_Clear(); PyErr_Clear();
#if PY_VERSION_HEX >= 0x03000000
{
long v = PyLong_AsLong(obj);
if (!PyErr_Occurred()) {
if (v < 0) {
return SWIG_OverflowError;
}
} else {
PyErr_Clear();
}
}
#endif
} }
} }
#ifdef SWIG_PYTHON_CAST_MODE #ifdef SWIG_PYTHON_CAST_MODE
@ -3576,7 +3573,7 @@ SWIGINTERN PyObject *_wrap_wiringPiFailure(PyObject *SWIGUNUSEDPARM(self), PyObj
PyObject *newargs; PyObject *newargs;
newargs = PyTuple_GetSlice(args,0,2); newargs = PyTuple_GetSlice(args,0,2);
varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1); varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args));
resultobj = _wrap_wiringPiFailure__varargs__(NULL,newargs,varargs); resultobj = _wrap_wiringPiFailure__varargs__(NULL,newargs,varargs);
Py_XDECREF(newargs); Py_XDECREF(newargs);
Py_XDECREF(varargs); Py_XDECREF(varargs);
@ -5979,7 +5976,7 @@ SWIGINTERN PyObject *_wrap_lcdPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *a
PyObject *newargs; PyObject *newargs;
newargs = PyTuple_GetSlice(args,0,2); newargs = PyTuple_GetSlice(args,0,2);
varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1); varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args));
resultobj = _wrap_lcdPrintf__varargs__(NULL,newargs,varargs); resultobj = _wrap_lcdPrintf__varargs__(NULL,newargs,varargs);
Py_XDECREF(newargs); Py_XDECREF(newargs);
Py_XDECREF(varargs); Py_XDECREF(varargs);
@ -7352,6 +7349,9 @@ SWIGINTERN PyObject *_wrap_wiringPiSPIDataRW(PyObject *SWIGUNUSEDPARM(self), PyO
SWIG_PYTHON_THREAD_END_ALLOW; SWIG_PYTHON_THREAD_END_ALLOW;
} }
resultobj = SWIG_From_int((int)(result)); resultobj = SWIG_From_int((int)(result));
{
resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromStringAndSize((char *) arg2, result));
}
return resultobj; return resultobj;
fail: fail:
return NULL; return NULL;
@ -7879,7 +7879,7 @@ SWIGINTERN PyObject *_wrap_serialPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject
PyObject *newargs; PyObject *newargs;
newargs = PyTuple_GetSlice(args,0,2); newargs = PyTuple_GetSlice(args,0,2);
varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1); varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args));
resultobj = _wrap_serialPrintf__varargs__(NULL,newargs,varargs); resultobj = _wrap_serialPrintf__varargs__(NULL,newargs,varargs);
Py_XDECREF(newargs); Py_XDECREF(newargs);
Py_XDECREF(varargs); Py_XDECREF(varargs);
@ -8267,8 +8267,6 @@ SWIG_InitializeModule(void *clientdata) {
swig_module_info *module_head, *iter; swig_module_info *module_head, *iter;
int found, init; int found, init;
clientdata = clientdata;
/* check to see if the circular list has been setup, if not, set it up */ /* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) { if (swig_module.next==0) {
/* Initialize the swig_module */ /* Initialize the swig_module */
@ -8306,7 +8304,7 @@ SWIG_InitializeModule(void *clientdata) {
module_head->next = &swig_module; module_head->next = &swig_module;
} }
/* When multiple interpeters are used, a module could have already been initialized in /* 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. 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 In this case, we do not want to continue adding types... everything should be
set up already */ set up already */
@ -8841,6 +8839,7 @@ SWIG_init(void) {
m = Py_InitModule((char *) SWIG_name, SwigMethods); m = Py_InitModule((char *) SWIG_name, SwigMethods);
#endif #endif
md = d = PyModule_GetDict(m); md = d = PyModule_GetDict(m);
(void)md;
SWIG_InitializeModule(0); SWIG_InitializeModule(0);

Loading…
Cancel
Save