lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Jeff Smith <spammealot1@live.co.uk> writes:
> Thanks for the suggestion, but I am already using SWIG in the embedded
> project I am working on. I chose Swig as it had the advantage of not
> having any Windows dependencies, so it was pretty easy to use in an
> embedded environment. I have found it has some limitations, for example
> as far as I can see it cannot really handle arrays of data, hence my
> question here.

Hmm, SWIG's default handling of arrays isn't so great, but it allows
enough customization that they can be accomodated ("table on the Lua
side, C-style array and count argument or std::vector on the C/C++
side") with some custom typemaps and code.

[There are SWIG bugs that make this a little annoying in some cases, at
least in some versions of SWIG though...]

For my attempts at doing some of this look at
https://github.com/snogglethorpe/snogray/blob/master/snograw.swg
and search for "[" or "std::vector".

-Miles

-- 
"Yorton, Wressle, and Gospel Oak, the richness of your heritage is ended.
We shall not stop at you again; for Dr Beeching stops at nothing."