summaryrefslogtreecommitdiff
path: root/ivycpy.i
diff options
context:
space:
mode:
Diffstat (limited to 'ivycpy.i')
-rw-r--r--ivycpy.i42
1 files changed, 33 insertions, 9 deletions
diff --git a/ivycpy.i b/ivycpy.i
index 3dcc449..5d1e142 100644
--- a/ivycpy.i
+++ b/ivycpy.i
@@ -774,31 +774,55 @@ pyIvyInit(
// SWIG typemap allowing us to grab a Python callable object
// -------------------------------------------------------------------
+/* %typemap(python,in) PyObject *PyFunc { */
+/* if (!PyCallable_Check($source)) { */
+/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */
+/* return NULL; */
+/* } */
+/* $target = $source; */
+/* } */
+
+/* %typemap(python,in) PyObject *PyFuncOnCx { */
+/* if (!PyCallable_Check($source)) { */
+/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */
+/* return NULL; */
+/* } */
+/* $target = $source; */
+/* } */
+
+/* %typemap(python,in) PyObject *PyFuncOnDie { */
+/* if (!PyCallable_Check($source)) { */
+/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */
+/* return NULL; */
+/* } */
+/* $target = $source; */
+/* } */
+
+// nouvelle syntaxe SWIG 1.3.x : $target -> $1 et $source -> $input
%typemap(python,in) PyObject *PyFunc {
- if (!PyCallable_Check($source)) {
+ if (!PyCallable_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Need a callable object!");
return NULL;
}
- $target = $source;
-}
+ $1 = $input;
+}
%typemap(python,in) PyObject *PyFuncOnCx {
- if (!PyCallable_Check($source)) {
+ if (!PyCallable_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Need a callable object!");
return NULL;
}
- $target = $source;
-}
+ $1 = $input;
+}
%typemap(python,in) PyObject *PyFuncOnDie {
- if (!PyCallable_Check($source)) {
+ if (!PyCallable_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Need a callable object!");
return NULL;
}
- $target = $source;
+ $1 = $input;
}
-
// part 3
// on place ici les donnees, fonctions a wrapper