|
From: Ervin H. <ai...@gm...> - 2016-10-23 19:30:37
|
Hi William,
thanks for the answer,
On Sun, Oct 23, 2016 at 08:15:28PM +0100, William S Fulton wrote:
> On 22 October 2016 at 18:43, Ervin Hegedüs <ai...@gm...> wrote:
> > I'm trying this way:
> >
> > %typemap(out) int [ANY] {
> > int len,i;
> > len = $1_dim0;
> > lua_createtable (L, len, 0);
> > for(i=0; i<len; i++) {
> > lua_pushinteger(L, (lua_Integer)$1[i]);
> > }
> > lua_settable(L, (-1)*(len+1));
> > }
> >
> > but in Lua script shows only this:
> >
> > nil
> >
> > What'em I missing? Could anybody helps in this problem?
>
>
> Have you looked at the Lua typemaps shipped with SWIG? I don't know
> Lua, but all the "out" typemaps increment SWIG_arg, so I'd try adding
> that in.
do you mean should I return the SWIG_arg from that typemap?
I've tested, but it doesn't work: the array in Lua is still "nil"
value, the expected value is "table: 0xaddr", when I just
reference that in a print() function.
thanks,
a.
--
I � UTF-8
|