Mercurial > pub > dyncall > bindings
diff python/pydc/pydcext.c @ 5:bf5625bb6f05
- brought python binding up to dc v0.9
author | cslag |
---|---|
date | Tue, 22 Mar 2016 01:49:34 +0100 |
parents | 0cfcc391201f |
children | a40084782546 |
line wrap: on
line diff
--- a/python/pydc/pydcext.c Tue Mar 22 00:55:15 2016 +0100 +++ b/python/pydc/pydcext.c Tue Mar 22 01:49:34 2016 +0100 @@ -221,7 +221,7 @@ dcArgPointer(gpCall, ptr ); } break; - case 'S': + case DC_SIGCHAR_STRING: { char* p; if (!PyString_Check(po) ) return PyErr_Format( PyExc_RuntimeError, "argument mismatch at pos %d - expecting a string", index ); @@ -244,15 +244,15 @@ switch(ch) { - case DC_SIGCHAR_VOID: dcCallVoid(gpCall, pfunc); Py_RETURN_NONE; - case DC_SIGCHAR_BOOL: return Py_BuildValue("i", dcCallBool(gpCall, pfunc) ); - case DC_SIGCHAR_INT: return Py_BuildValue("i", dcCallInt(gpCall, pfunc) ); - case DC_SIGCHAR_LONGLONG: return Py_BuildValue("L", (unsigned long long) dcCallLongLong(gpCall, pfunc) ); - case DC_SIGCHAR_FLOAT: return Py_BuildValue("f", dcCallFloat(gpCall, pfunc) ); - case DC_SIGCHAR_DOUBLE: return Py_BuildValue("d", dcCallDouble(gpCall, pfunc) ); - case 's': return Py_BuildValue("s", dcCallPointer(gpCall, pfunc) ); - case DC_SIGCHAR_POINTER: return Py_BuildValue("p", dcCallPointer(gpCall, pfunc) ); - default: return PyErr_Format( PyExc_RuntimeError, "invalid return type signature" ); + case DC_SIGCHAR_VOID: dcCallVoid (gpCall, pfunc); Py_RETURN_NONE; + case DC_SIGCHAR_BOOL: return Py_BuildValue("i", dcCallBool (gpCall, pfunc)); + case DC_SIGCHAR_INT: return Py_BuildValue("i", dcCallInt (gpCall, pfunc)); + case DC_SIGCHAR_LONGLONG: return Py_BuildValue("L", (unsigned long long)dcCallLongLong(gpCall, pfunc)); + case DC_SIGCHAR_FLOAT: return Py_BuildValue("f", dcCallFloat (gpCall, pfunc)); + case DC_SIGCHAR_DOUBLE: return Py_BuildValue("d", dcCallDouble (gpCall, pfunc)); + case DC_SIGCHAR_STRING: return Py_BuildValue("s", dcCallPointer (gpCall, pfunc)); + case DC_SIGCHAR_POINTER: return Py_BuildValue("p", dcCallPointer (gpCall, pfunc)); + default: return PyErr_Format( PyExc_RuntimeError, "invalid return type signature"); } }