Calling C function from lua
Can someone tell me is it p开发者_开发技巧ossible to somehow call c function or simply wrap it into a lua function WITHOUT building a new module.
If it works for you, try the FFI library. See also luaffi.
Lua can't call arbitrary C functions - they have to be bound to something in the Lua namespace first. (This is intentional to prevent breaking out of sandboxes in embedded applications.)
Or the Alien library.
精彩评论