摘要: 转载出处:http://my.oschina.net/xhan/blog/307171先来看一下 Lua 中常用的几个数据结构:先看一下 opcode.h 中的:Type 枚举是 Lua 中的几种数据类型。 1 typedef enum 2 { 3 T_MARK, 4 T_NIL, 5 T_N... 阅读全文
posted @ 2015-11-02 20:57 vd01 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 转载出处:http://my.oschina.net/xhan/blog/306719从 lua.c 的 main 函数开始,看看在代码执行过程中中发生了什么?12345if(argc=MAXSTACK-1){lua_error("stackoverflow");return1;}tag(top)=... 阅读全文
posted @ 2015-11-02 20:35 vd01 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 转载出处:http://my.oschina.net/xhan/blog/306308源文件简介:floatingpoint.h 空文件,没什么用。hash.h 最大的结构的保存位置,Lua 中需要内存回收的都放在它里面,比如 string 和 关联数组。inout.h 从文件名可以看出是输入输出,... 阅读全文
posted @ 2015-11-02 20:33 vd01 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 转载出处:http://my.oschina.net/xhan/blog/305949先来个 hello, world! 看看解释器是否能正常工作:print("hello, world") 可以正常输出,说明解释器能正常干活。再看看几个官方自带的测试文件是干什么的:array.lua$debuga... 阅读全文
posted @ 2015-11-02 20:32 vd01 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 转载出处:http://my.oschina.net/xhan/blog/305943从官网 www.lua.org/ftp/lua-1.0.tar.gz 下代码。如何编译,ReadMe 里有这样的说明:The code compiles and runs in RedHat 5.2 with gc... 阅读全文
posted @ 2015-11-02 20:14 vd01 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 转载出处:http://my.oschina.net/xhan/blog/305539为什么是 Lua 忘记是什么时候接触到 Lua 的了,也忘记是为什么接触到她的。现在想想,也许是因为下面两个原因: WOW 里有用到她,我上学的时候,玩过一段时间 WOW,了解一点 WOW 插件的编写,当时觉得这个... 阅读全文
posted @ 2015-11-02 20:13 vd01 阅读(430) 评论(0) 推荐(0) 编辑