FAQ Database Discussion Community


C++ and Lua integration with arguments (…) (Lua 5.1)

c++,lua,lua-api
I'm currently trying to pass a function from C++ to Lua. Problem is that this function has a parameter of (int, int, char *, ...). I'm pretty new at using Lua as well. So I got all the arguments from the lua stack, and I put the relevant (...) ones...

Lua table of string values as parameter in C function

c,arrays,lua,lua-table,lua-api
I want to make a C function that takes a lua table with strings as parameter, and the lua table does not have any keys, just values. How can I do this? I cannot figure it out. I did not find anything when I searched in google.

Get table as auto argument when calling C function from the same table field

c,lua,lua-table,lua-api
I have several global integer variables, like A0, A1, A2 in Lua script. They are declared on C side. Each of them contains unique numeric value. In a script user manipulates device pins using this aliases: set_pin_bool(A0, 1) And this calls corresponding C function. I think it is too C-like...