2014年3月9日

Calling Lua From a C Program

摘要: IntroductionFrom a running C program, you can call a Lua script. The C program can pass arguments to the Lua script, and the Lua script can pass back a return. The Lua script can serve to initialize the C program, or the Lua script can install a callback routine in the C program.Calling a Lua script 阅读全文

posted @ 2014-03-09 03:32 Step-BY-Step 阅读(398) 评论(0) 推荐(0) 编辑

First Lua function running in C

摘要: 这是我在C里面跑出来的第一个Lua 文件, 纪念一下。1.Set up envirnonment:Mac下面 Lua的src (即include) 和lib(binary)是分开的, 所以需要分别下载。使用的是 5.2.3 的src 和 standard lib(5.2.1_MacOS107_lib).include 和 lib 在gcc 编译的时候需要用-L 引入。2.代码:VERY IMPORTANT:ua_open() should not be used. In lua-5.1 it's still available as simple wrapper macro for l 阅读全文

posted @ 2014-03-09 03:26 Step-BY-Step 阅读(205) 评论(0) 推荐(0) 编辑

导航