From 2824b0cbb66e715490e1ef13250bd675d87b32d9 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 2 Jun 2010 20:53:17 +0000 Subject: rel-2.0.0 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-2.0.0@12089 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- trunk/Examples/python/swigrun/example.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 trunk/Examples/python/swigrun/example.cxx (limited to 'trunk/Examples/python/swigrun/example.cxx') diff --git a/trunk/Examples/python/swigrun/example.cxx b/trunk/Examples/python/swigrun/example.cxx new file mode 100644 index 000000000..25906a559 --- /dev/null +++ b/trunk/Examples/python/swigrun/example.cxx @@ -0,0 +1,20 @@ +/* File : example.cxx */ + +#include +#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; +} + -- cgit v1.2.1