lua.h
开头有定义版本号,这里用的5.4.6
#define LUA_VERSION_MAJOR "5"
#define LUA_VERSION_MINOR "4"
#define LUA_VERSION_RELEASE "6"
#define LUA_VERSION_NUM 504
#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 6)
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2023 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
Lua数据结构类型定义
/*
** basic types
*/
#define LUA_TNONE (-1) //无类型
#define LUA_TNIL 0 //空类型
#define LUA_TBOOLEAN 1 //布尔类型
#define LUA_TLIGHTUSERDATA 2 //指针 //void *
#define LUA_TNUMBER 3 //数据 //lua_Number
#define LUA_TSTRING 4 //字符串 //TString
#define LUA_TTABLE 5 //表 //Table
#define LUA_TFUNCTION 6 //函数 //CClosure、LClosure
#define LUA_TUSERDATA 7 //Lua内部指针 //void *
#define LUA_TTHREAD 8 //Lua虚拟机、协程 //lua_State
#define LUA_NUMTYPES 9 //类型数目
lobject.h
存储数据结构文件
数据类型扩展
/*
** Extra types for collectable non-values
*/
#define LUA_TUPVAL LUA_NUMTYPES /* upvalues */
#define LUA_TPROTO (LUA_NUMTYPES+