调用从Lua C函数 [英] Calling C function from lua
本文介绍了调用从Lua C函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我是否有可能以某种方式调用C函数或简单地将它包装成一个lua功能无需建立一个新的模块。
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.
推荐答案
的Lua不能调用任意C函数 - 它们必须在Lua的命名空间第一次绑定的东西。 (这是故意的,以prevent在嵌入式应用中打破沙箱的。)
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.)
这篇关于调用从Lua C函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文