Can someone tell me is it possible to somehow call c function or simply wrap it into a lua function WITHOUT building a new module.
3 Answers
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.)
2 Comments
unresolved_external
so as far as I understand I have two ways to solve this problem: first - run lua script from C, and than wrap C functions and push them into a stack, and second - build a new module for lua. Am I right?
Amber
Correct. You can dynamically bind C functions via the C API, or you can create a module that does that binding.