[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling C functions from Lua Code
- From: "Victor Bombi" <sonoro@...>
- Date: Fri, 4 Jul 2014 19:50:26 +0200
Do you mean a lua_CFunction? Thats a function that has to be "exported" to
lua with lua_register or similar
or you mean a regular C function?
for the first case you have the name in lua that can be used as
for the second case you need ffi that you can get with luajit or in plain
lua with any ffi module.
----- Original Message -----
From: Austin Einter
To: Lua mailing list
Sent: Friday, July 04, 2014 7:05 PM
Subject: Calling C functions from Lua Code
I have a requirement as below.
1. From C code, call lua function ( I know how to do it)
2. While lua function is being executed, call a C function
3. Lua function returns
4. C code completes and program terminates
Hope it should be possible.
Can somebody please help me how to implement above point 2 (how to call a C
function from Lua).