summaryrefslogtreecommitdiff
path: root/Examples/python/swigrun/example.cxx
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2009-08-18 20:56:02 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-25 16:59:08 +0000
commit9f8a09ed743cedd9547bf0661d518647966ab114 (patch)
tree9c7803d3b27a8ec22e91792ac7f7932efa128b20 /Examples/python/swigrun/example.cxx
downloadswig-tarball-master.tar.gz
Imported from /srv/lorry/lorry-area/swig-tarball/swig-1.3.40.tar.gz.HEADswig-1.3.40master
Diffstat (limited to 'Examples/python/swigrun/example.cxx')
-rw-r--r--Examples/python/swigrun/example.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Examples/python/swigrun/example.cxx b/Examples/python/swigrun/example.cxx
new file mode 100644
index 0000000..25906a5
--- /dev/null
+++ b/Examples/python/swigrun/example.cxx
@@ -0,0 +1,20 @@
+/* File : example.cxx */
+
+#include <Python.h>
+#include "swigpyrun.h"
+#include "example.h"
+
+
+Manager* convert_to_Manager(PyObject *py_obj)
+{
+ Manager* c_ptr;
+ swig_type_info *ty = SWIG_TypeQuery("Manager *");
+ printf("manager ty %p \n", ty);
+ if (SWIG_ConvertPtr(py_obj, (void **) &c_ptr, ty, 0) == -1) {
+ c_ptr = 0;
+ } else {
+ Py_XINCREF(py_obj);
+ }
+ return c_ptr;
+}
+