Add Lua pointer reference typemaps

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10363 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-04-07 20:06:37 +00:00
commit 929f68b069
4 changed files with 21 additions and 3 deletions

View file

@ -159,12 +159,16 @@
%}
// Also needed for object ptrs by const ref
// eg const A* ref_pointer(A* const& a);
// eg A* const& ref_pointer(A* const& a);
// found in mixed_types.i
%typemap(in,checkfn="lua_isuserdata") SWIGTYPE* const &($*ltype temp)
%typemap(in,checkfn="lua_isuserdata") SWIGTYPE *&($*ltype temp)
%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname");
$1=&temp;%}
%typemap(out) SWIGTYPE *&
%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %}
// DISOWN-ing typemaps
// if you have an object pointer which must be disowned, use this typemap
// eg. for void destroy_foo(Foo* toDie);