The second is to write a program primarily in C, then use embedded Lua as a way to store and report data and configuration.
第二种方法是主要用 C 编写一个程序,然后使用嵌入的 Lua 来存储和报告数据和配置。
The third, and most flexible, is to mix and match these approaches, using Lua to script some actions, and code in C to manage others.
第三种方式,也是最灵活的方式,是混合上述两种方式,使用 Lua 脚本编写一些动作,而用 C 代码管理其他部分。
C functions can call Lua functions and vice versa, for example.
举例来说,c函数可以调用lua函数,反之亦然。
应用推荐