What I’m looking for is something like:
lua script
MY_ARRAY = {
00, 10, 54, 32,
12, 31, 55, 43,
34, 65, 76, 34,
53, 78, 34, 93
}
c code
lua_Number array[] = lua_getarray("MY_ARRAY");
Is this possible? Is there anything similar to make dealing with lua tables in C easier.
You can write such function yourself! It shouldn’t be too many lines. But it’s better to use pointers than arrays, because they can point to any number of elements. The interface could be something like this:
And the implementation should use the following functions (from http://www.lua.org/manual/5.2/manual.html):