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.
Asked
Active
Viewed 2,300 times
3 Answers
5
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.)

Amber
- 507,862
- 82
- 626
- 550
-
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? – unresolved_external Oct 03 '11 at 13:06
-
Correct. You can dynamically bind C functions via the C API, or you can create a module that does that binding. – Amber Oct 03 '11 at 13:11