lua-users home
lua-l archive

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

On 07/02/2011 23:38, Steve Litt wrote:
I already know how to call and run Lua functions from a C program, but haven't
been able to find clear documentation on how to run a C function from a Lua
program. Does anyone know of a web page showing a simple proof of concept for
calling and running a C function from a Lua 5.1 program?

Actually, you do that by adding a Lua function wrapping the C function.
You can find plenty of examples in the Lua standard library... :-)
And it gives a chance to allow doing things in a more Lua-esque style (optional parameters, multiple return values, etc.).

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --