跳轉到內容

BlitzMax/Modules/Other/Lua 核心

來自華夏公益教科書

"Lua 是一種擴充套件程式語言,旨在支援具有資料描述功能的一般程序式程式設計。它還提供對面向物件程式設計、函數語言程式設計和資料驅動程式設計的良好支援。Lua 旨在用作任何需要它的程式的強大、輕量級指令碼語言。"(摘自 Roberto Ierusalimschy、Luiz Henrique de Figueiredo、Waldemar Celes 的“Lua 5.1 參考手冊”)

此模組為 Lua 主 API 和輔助 API 提供了一個 BlitzMax 介面。它幾乎完整,唯一缺少的函式是那些具有可變引數列表的函式(BlitzMax 目前尚不支援)。

axe.lua 包還包含完整的 Lua 5.1.4 發行版。Lua 原始碼已完全整合到模組中,不再需要額外的 DLL(或共享庫)。

Lua 文件

[編輯 | 編輯原始碼]

Lua 參考手冊是此發行版的一部分,可以從此處直接訪問

可以在 Lua 網站 上找到更多資訊;Lua wiki 包含更多材料 關於此模組 和相關包的資訊。

以下描述並非教程,但仍然可以幫助您在 BlitzMax 中開始 Lua 程式設計。更多與 API 相關的資料可以在 Lua 參考手冊 中找到。

設定 Lua VM

[編輯 | 編輯原始碼]

執行 Lua 指令碼總是需要至少例項化一個 Lua VM。

local LuaState:byte ptr = luaL_newstate()

該例項化的結果是指向一個結構體的指標,該結構體包含了新 VM 的完整狀態,必須作為第一個引數傳遞給幾乎所有其他 Lua API 函式。

現在是時候“開啟”內建的 Lua 庫了(注意:這些庫現在是 axe.lua 的一部分,不需要外部 DLL 或共享庫)。

luaL_openlibs(LuaState)

始終透過開啟其庫來初始化 Lua VM,除非你真的知道自己在做什麼!

通常情況下,建立單個 Lua 狀態就足夠了,甚至進一步的(Lua)執行緒共享基本的 Lua 狀態(及其關聯的環境)。

關閉 Lua VM

[編輯 | 編輯原始碼]

最後,始終關閉 Lua VM 是一個好主意。

lua_close(LuaState)

Lua 直譯器現在已經終止,其狀態變數不再有效。

訪問 Lua 全域性變數

[編輯 | 編輯原始碼]

程式碼

lua_pushstring(LuaState, "BMXString")
lua_setglobal (LuaState, "luaglobal")

定義一個全域性 Lua 變數(稱為 luaglobal),它包含一個字串(即“BMXString”)。

註冊 BlitzMax 函式

[編輯 | 編輯原始碼]

為了從 Lua 指令碼中訪問 BlitzMax 功能,有必要實現合適的 BlitzMax 函式並在 Lua VM 中註冊它們。

此類 BlitzMax 函式通常如下所示

function BMXName:int (LuaState:Byte Ptr)
   ...      ' handling of parameters passed from Lua (if required)
     ...    ' actual function body
   ...      ' passing results back to Lua (if required)
   return 0 ' number of values returned to Lua
 end function

然後使用以下方法註冊此類函式

lua_register(LuaState, "luaname", BMXName)

此命令在 Lua 中將 BlitzMax 函式(稱為 BMXName)註冊為(全域性)名稱 luaname。這兩個名稱可以相同,但不必相同。

從 BlitzMax 中執行 Lua 指令碼

[編輯 | 編輯原始碼]

程式碼

local Result:int = luaL_loadString(LuaState,LuaScript)
 if (Result <> 0) then
   ' ERROR!!!
   lua_close(LuaState) ' just to be complete
   end
 end if

載入並編譯包含 Lua 指令碼的(BlitzMax)字串。編譯結果將保留在(Lua)堆疊上。

lua_getfield(LuaState, LUA_GLOBALSINDEX, "debug")' get global "debug"
 lua_getfield(LuaState, -1, "traceback")       ' get "debug.traceback"
 lua_remove (LuaState, -2)           ' remove "debug" table from stack

 Result = lua_pcall(LuaState,1,-1,-1)' use "debug.traceback" as err.hdlr
 if (Result <> 0) then
   ' ERROR
   lua_close(LuaState) ' just to be complete
   end
 end if

實際上評估先前載入的指令碼。前面提到的 Lua 命令只是為 Lua 指令碼失敗時的正確錯誤訊息做準備。

Lua_atpanic

[編輯 | 編輯原始碼]

函式 lua_atpanic:Byte Ptr (lua_state:Byte Ptr, panicf:Int(ls:Byte Ptr)

描述:參見 Lua 參考手冊

函式 lua_call (lua_state:Byte Ptr, nargs:Int, nresults:Int)

描述:參見 Lua 參考手冊

Lua_checkstack

[編輯 | 編輯原始碼]

函式 lua_checkstack:Int (lua_state:Byte Ptr, extra:Int)

描述:參見 Lua 參考手冊

Lua_close

[編輯 | 編輯原始碼]

函式 lua_close (lua_state:Byte Ptr)

描述:參見 Lua 參考手冊

Lua_concat

[編輯 | 編輯原始碼]

函式 lua_concat (lua_state:Byte Ptr, n:Int)

描述:參見 Lua 參考手冊

Lua_cpcall

[編輯 | 編輯原始碼]

函式 lua_cpcall:Int (lua_state:Byte Ptr, func:Int(ls:Byte Ptr)

描述:參見 Lua 參考手冊

Lua_createtable

[編輯 | 編輯原始碼]

函式 lua_createtable (lua_state:Byte Ptr, narr:Int, nrec:Int)

描述:參見 Lua 參考手冊

函式 lua_dump:Int (lua_state:Byte Ptr, writer:Int(ls:Byte Ptr,p:Byte Ptr,sz:Int,ud:Byte Ptr)

描述:參見 Lua 參考手冊

Lua_equal

[編輯 | 編輯原始碼]

函式 lua_equal:Int (lua_state:Byte Ptr, index1:Int, index2:Int)

描述:參見 Lua 參考手冊

Lua_error

[編輯 | 編輯原始碼]

函式 lua_error:Int (lua_state:Byte Ptr)

描述:參見 Lua 參考手冊

函式 lua_gc:Int (lua_state:Byte Ptr, what:Int, data:Int)

描述:參見 Lua 參考手冊

Lua_getallocf

[編輯 | 編輯原始碼]

函式 lua_getallocf:Byte Ptr (lua_state:Byte Ptr, ud:Byte Ptr Ptr)

描述:參見 Lua 參考手冊

Lua_getfenv

[編輯 | 編輯原始碼]

函式 lua_getfenv (lua_state:Byte Ptr, index:Int)

描述:參見 Lua 參考手冊

Lua_getfield

[編輯 | 編輯原始碼]

函式 lua_getfield (lua_state:Byte Ptr, index:Int, k$z)

描述: 請參考 Lua 參考手冊

Lua_gethook

[編輯 | 編輯原始碼]

函式 lua_gethook:Byte Ptr (lua_state:Byte Ptr)

描述: 請參考 Lua 參考手冊

Lua_gethookcount

[編輯 | 編輯原始碼]

函式 lua_gethookcount:Int (lua_state:Byte Ptr)

描述: 請參考 Lua 參考手冊

Lua_gethookmask

[編輯 | 編輯原始碼]

函式 lua_gethookmask:Int (lua_state:Byte Ptr)

描述: 請參考 Lua 參考手冊

Lua_getinfo

[編輯 | 編輯原始碼]

函式 lua_getinfo:Int (lua_state:Byte Ptr, what$z, ar:lua_Debug Ptr)

描述: 請參考 Lua 參考手冊

Lua_getlocal

[編輯 | 編輯原始碼]

函式 lua_getlocal$z (lua_state:Byte Ptr, ar:lua_Debug Ptr, n:Int)

描述: 請參考 Lua 參考手冊

Lua_getmetatable

[編輯 | 編輯原始碼]

函式 lua_getmetatable:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_getstack

[編輯 | 編輯原始碼]

函式 lua_getstack:Int (lua_state:Byte Ptr, level:Int, ar:lua_Debug Ptr)

描述: 請參考 Lua 參考手冊

Lua_gettable

[編輯 | 編輯原始碼]

函式 lua_gettable (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_gettop

[編輯 | 編輯原始碼]

函式 lua_gettop:Int (lua_state:Byte Ptr)

描述: 請參考 Lua 參考手冊

Lua_getupvalue

[編輯 | 編輯原始碼]

函式 lua_getupvalue$z (lua_state:Byte Ptr, funcindex:Int, n:Int)

描述: 請參考 Lua 參考手冊

Lua_insert

[編輯 | 編輯原始碼]

函式 lua_insert (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_iscfunction

[編輯 | 編輯原始碼]

函式 lua_iscfunction:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_isnumber

[編輯 | 編輯原始碼]

函式 lua_isnumber:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_isstring

[編輯 | 編輯原始碼]

函式 lua_isstring:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_isuserdata

[編輯 | 編輯原始碼]

函式 lua_isuserdata:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_lessthan

[編輯 | 編輯原始碼]

函式 lua_lessthan:Int (lua_state:Byte Ptr, index1:Int, index2:Int)

描述: 請參考 Lua 參考手冊

函式 lua_load:Int (lua_state:Byte Ptr, reader:Byte Ptr(ls:Byte Ptr,data:Byte Ptr,sz:Int Ptr)

描述: 請參考 Lua 參考手冊

Lua_newstate

[編輯 | 編輯原始碼]

函式 lua_newstate:Byte Ptr (f:Byte Ptr(ud:Byte Ptr, p:Byte Ptr, osize:Int, nsize:Int)

描述: 請參考 Lua 參考手冊

Lua_newthread

[編輯 | 編輯原始碼]

函式 lua_newthread:Byte Ptr (lua_state:Byte Ptr)

描述: 請參考 Lua 參考手冊

Lua_newuserdata

[編輯 | 編輯原始碼]

函式 lua_newuserdata:Byte Ptr (lua_state:Byte Ptr, size:Int)

描述: 請參考 Lua 參考手冊

函式 lua_next:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_objlen

[編輯 | 編輯原始碼]

函式 lua_objlen:Int (lua_state:Byte Ptr, index:Int)

描述: 請參考 Lua 參考手冊

Lua_pcall

[編輯 | 編輯原始碼]

函式 lua_pcall:Int (lua_state:Byte Ptr, nargs:Int, nresults:Int, errfunc:Int)

描述: 請參考 Lua 參考手冊

Lua_pushboolean

[編輯 | 編輯原始碼]

函式 lua_pushboolean (lua_state:Byte Ptr, b:Int)

描述: 請參見 Lua 參考手冊

Lua_pushcclosure

[編輯 | 編輯原始碼]

函式 lua_pushcclosure (lua_state:Byte Ptr, fn:Int(ls:Byte Ptr)

描述: 請參見 Lua 參考手冊

Lua_pushinteger

[編輯 | 編輯原始碼]

函式 lua_pushinteger (lua_state:Byte Ptr, n:Int)

描述: 請參見 Lua 參考手冊

Lua_pushlightuserdata

[編輯 | 編輯原始碼]

函式 lua_pushlightuserdata (lua_state:Byte Ptr, p:Byte Ptr)

描述: 請參見 Lua 參考手冊

Lua_pushlstring

[編輯 | 編輯原始碼]

函式 lua_pushlstring (lua_state:Byte Ptr, s:Byte Ptr, size:Int)

描述: 請參見 Lua 參考手冊

Lua_pushnil

[編輯 | 編輯原始碼]

函式 lua_pushnil (lua_state:Byte Ptr)

描述: 請參見 Lua 參考手冊

Lua_pushnumber

[編輯 | 編輯原始碼]

函式 lua_pushnumber (lua_state:Byte Ptr, n:Double)

描述: 請參見 Lua 參考手冊

Lua_pushstring

[編輯 | 編輯原始碼]

函式 lua_pushstring (lua_state:Byte Ptr, s$z)

描述: 請參見 Lua 參考手冊

Lua_pushthread

[編輯 | 編輯原始碼]

函式 lua_pushthread:Int (lua_state:Byte Ptr)

描述: 請參見 Lua 參考手冊

Lua_pushvalue

[編輯 | 編輯原始碼]

函式 lua_pushvalue (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_rawequal

[編輯 | 編輯原始碼]

函式 lua_rawequal:Int (lua_state:Byte Ptr, index1:Int, index2:Int)

描述: 請參見 Lua 參考手冊

Lua_rawget

[編輯 | 編輯原始碼]

函式 lua_rawget (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_rawgeti

[編輯 | 編輯原始碼]

函式 lua_rawgeti (lua_state:Byte Ptr, index:Int, n:Int)

描述: 請參見 Lua 參考手冊

Lua_rawset

[編輯 | 編輯原始碼]

函式 lua_rawset (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_rawseti

[編輯 | 編輯原始碼]

函式 lua_rawseti (lua_state:Byte Ptr, index:Int, n:Int)

描述: 請參見 Lua 參考手冊

Lua_remove

[編輯 | 編輯原始碼]

函式 lua_remove (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_replace

[編輯 | 編輯原始碼]

函式 lua_replace (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_resume

[編輯 | 編輯原始碼]

函式 lua_resume:Int (lua_state:Byte Ptr, narg:Int)

描述: 請參見 Lua 參考手冊

Lua_setallocf

[編輯 | 編輯原始碼]

函式 lua_setallocf (lua_state:Byte Ptr, f:Byte Ptr(ud:Byte Ptr, p:Byte Ptr, osize:Int, nsize:Int)

描述: 請參見 Lua 參考手冊

Lua_setfenv

[編輯 | 編輯原始碼]

函式 lua_setfenv:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_setfield

[編輯 | 編輯原始碼]

函式 lua_setfield (lua_state:Byte Ptr, index:Int, k$z)

描述: 請參見 Lua 參考手冊

Lua_sethook

[編輯 | 編輯原始碼]

函式 lua_sethook:Int (lua_state:Byte Ptr, f(ls:Byte Ptr,ar:lua_Debug Ptr)

描述: 請參見 Lua 參考手冊

Lua_setlocal

[編輯 | 編輯原始碼]

函式 lua_setlocal$z (lua_state:Byte Ptr, ar:lua_Debug Ptr, n:Int)

描述: 請參見 Lua 參考手冊

Lua_setmetatable

[編輯 | 編輯原始碼]

函式 lua_setmetatable:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_settable

[編輯 | 編輯原始碼]

函式 lua_settable (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_settop

[編輯 | 編輯原始碼]

函式 lua_settop (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_setupvalue

[編輯 | 編輯原始碼]

函式 lua_setupvalue$z (lua_state:Byte Ptr, funcindex:Int, n:Int)

描述: 請參見 Lua 參考手冊

Lua_status

[編輯 | 編輯原始碼]

函式 lua_status:Int (lua_state:Byte Ptr)

描述: 請參見 Lua 參考手冊

Lua_toboolean

[編輯 | 編輯原始碼]

函式 lua_toboolean:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_tocfunction

[編輯 | 編輯原始碼]

函式 lua_tocfunction:Byte Ptr (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_tointeger

[編輯 | 編輯原始碼]

函式 lua_tointeger:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_tolstring

[編輯 | 編輯原始碼]

函式 lua_tolstring:Byte Ptr (lua_state:Byte Ptr, index:Int, size:Int Ptr)

描述: 請參見 Lua 參考手冊

Lua_tonumber

[編輯 | 編輯原始碼]

函式 lua_tonumber:Double (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_topointer

[編輯 | 編輯原始碼]

函式 lua_topointer:Byte Ptr (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_tothread

[編輯 | 編輯原始碼]

函式 lua_tothread:Byte Ptr (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_touserdata

[編輯 | 編輯原始碼]

函式 lua_touserdata:Byte Ptr (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

函式 lua_type:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_typename

[編輯 | 編輯原始碼]

函式 lua_typename$z (lua_state:Byte Ptr, tp:Int)

描述: 請參見 Lua 參考手冊

Lua_xmove

[編輯 | 編輯原始碼]

函式 lua_xmove (fromState:Byte Ptr, toState:Byte Ptr, n:Int)

描述: 請參見 Lua 參考手冊

Lua_yield

[編輯 | 編輯原始碼]

函式 lua_yield:Int (lua_state:Byte Ptr, nresults:Int)

描述: 請參見 Lua 參考手冊

Lua_getglobal

[編輯 | 編輯原始碼]

函式 lua_getglobal (lua_state:Byte Ptr, name:String)

描述: 請參見 Lua 參考手冊

Lua_isboolean

[編輯 | 編輯原始碼]

函式 lua_isboolean:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_isfunction

[編輯 | 編輯原始碼]

函式 lua_isfunction:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_islightuserdata

[編輯 | 編輯原始碼]

函式 lua_islightuserdata:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_isnil

[編輯 | 編輯原始碼]

函式 lua_isnil:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_isnone

[編輯 | 編輯原始碼]

函式 lua_isnone:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_isnoneornil

[編輯 | 編輯原始碼]

函式 lua_isnoneornil:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_istable

[編輯 | 編輯原始碼]

函式 lua_istable:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_isthread

[編輯 | 編輯原始碼]

函式 lua_isthread:Int (lua_state:Byte Ptr, index:Int)

描述: 請參見 Lua 參考手冊

Lua_newtable

[編輯 | 編輯原始碼]

函式 lua_newtable (lua_state:Byte Ptr)

描述: 參見 Lua 參考手冊

函式 lua_pop (lua_state:Byte Ptr, n:Int)

描述: 參見 Lua 參考手冊

Lua_pushcfunction

[編輯 | 編輯原始碼]

函式 lua_pushcfunction (lua_state:Byte Ptr, fn:Int(ls:Byte Ptr)

描述: 參見 Lua 參考手冊

Lua_register

[編輯 | 編輯原始碼]

函式 lua_register (lua_state:Byte Ptr, name:String, f:Int(ls:Byte Ptr)

描述: 參見 Lua 參考手冊

Lua_setglobal

[編輯 | 編輯原始碼]

函式 lua_setglobal (lua_state:Byte Ptr, name:String)

描述: 參見 Lua 參考手冊

Lua_tostring

[編輯 | 編輯原始碼]

函式 lua_tostring:String (lua_state:Byte Ptr, index:Int)

描述: 參見 Lua 參考手冊

LuaL_addlstring

[編輯 | 編輯原始碼]

函式 luaL_addlstring (B:Byte Ptr, s:Byte Ptr, l:Int)

描述: 參見 Lua 參考手冊

LuaL_addsize

[編輯 | 編輯原始碼]

函式 luaL_addsize (B:Byte Ptr, size:Int)

描述: 參見 Lua 參考手冊

LuaL_addstring

[編輯 | 編輯原始碼]

函式 luaL_addstring (B:Byte Ptr, s$z)

描述: 參見 Lua 參考手冊

LuaL_addvalue

[編輯 | 編輯原始碼]

函式 luaL_addvalue (B:Byte Ptr)

描述: 參見 Lua 參考手冊

LuaL_argerror

[編輯 | 編輯原始碼]

函式 luaL_argerror:Int (lua_state:Byte Ptr, narg:Int, extramsg$z)

描述: 參見 Lua 參考手冊

LuaL_buffinit

[編輯 | 編輯原始碼]

函式 luaL_buffinit (lua_state:Byte Ptr, B:Byte Ptr)

描述: 參見 Lua 參考手冊

LuaL_callmeta

[編輯 | 編輯原始碼]

函式 luaL_callmeta:Int (lua_state:Byte Ptr, obj:Int, e$z)

描述: 參見 Lua 參考手冊

LuaL_checkany

[編輯 | 編輯原始碼]

函式 luaL_checkany (lua_state:Byte Ptr, narg:Int)

描述: 參見 Lua 參考手冊

LuaL_checkinteger

[編輯 | 編輯原始碼]

函式 luaL_checkinteger:Int (lua_state:Byte Ptr, narg:Int)

描述: 參見 Lua 參考手冊

LuaL_checklstring

[編輯 | 編輯原始碼]

函式 luaL_checklstring:Byte Ptr (lua_state:Byte Ptr, narg:Int, size:Int Ptr)

描述: 參見 Lua 參考手冊

LuaL_checknumber

[編輯 | 編輯原始碼]

函式 luaL_checknumber:Double (lua_state:Byte Ptr, narg:Int)

描述: 參見 Lua 參考手冊

LuaL_checkstack

[編輯 | 編輯原始碼]

函式 luaL_checkstack (lua_state:Byte Ptr, sz:Int, msg$z)

描述: 參見 Lua 參考手冊

LuaL_checktype

[編輯 | 編輯原始碼]

函式 luaL_checktype (lua_state:Byte Ptr, narg:Int, t:Int)

描述: 參見 Lua 參考手冊

LuaL_checkudata

[編輯 | 編輯原始碼]

函式 luaL_checkudata:Byte Ptr (lua_state:Byte Ptr, narg:Int, tname$z)

描述: 參見 Lua 參考手冊

LuaL_getmetafield

[編輯 | 編輯原始碼]

函式 luaL_getmetafield:Int (lua_state:Byte Ptr, obj:Int, e$z)

描述: 參見 Lua 參考手冊

LuaL_gsub

[編輯 | 編輯原始碼]

函式 luaL_gsub$z (lua_state:Byte Ptr, s$z, p$z, r$z)

描述: 參見 Lua 參考手冊

LuaL_loadbuffer

[編輯 | 編輯原始碼]

函式 luaL_loadbuffer:Int (lua_state:Byte Ptr, buff:Byte Ptr, sz:Int, name$z)

描述: 參見 Lua 參考手冊

LuaL_loadfile

[編輯 | 編輯原始碼]

函式 luaL_loadfile:Int (lua_state:Byte Ptr, filename$z)

描述: 請參閱 Lua 參考手冊

LuaL_loadstring

[編輯 | 編輯原始碼]

函式 luaL_loadstring:Int (lua_state:Byte Ptr, s$z)

描述: 請參閱 Lua 參考手冊

LuaL_newmetatable

[編輯 | 編輯原始碼]

函式 luaL_newmetatable:Int (lua_state:Byte Ptr, tname$z)

描述: 請參閱 Lua 參考手冊

LuaL_newstate

[編輯 | 編輯原始碼]

函式 luaL_newstate:Byte Ptr ()

描述: 請參閱 Lua 參考手冊

LuaL_openlibs

[編輯 | 編輯原始碼]

函式 luaL_openlibs (lua_state:Byte Ptr)

描述: 請參閱 Lua 參考手冊

LuaL_optinteger

[編輯 | 編輯原始碼]

函式 luaL_optinteger:Int (lua_state:Byte Ptr, narg:Int, d:Int)

描述: 請參閱 Lua 參考手冊

LuaL_optlstring

[編輯 | 編輯原始碼]

函式 luaL_optlstring:Byte Ptr (lua_state:Byte Ptr, narg:Int, d$z, size:Int Ptr)

描述: 請參閱 Lua 參考手冊

LuaL_optnumber

[編輯 | 編輯原始碼]

函式 luaL_optnumber:Double (lua_state:Byte Ptr, narg:Int, d:Double)

描述: 請參閱 Lua 參考手冊

LuaL_prepbuffer

[編輯 | 編輯原始碼]

函式 luaL_prepbuffer:Byte Ptr (B:Byte Ptr)

描述: 請參閱 Lua 參考手冊

LuaL_pushresult

[編輯 | 編輯原始碼]

函式 luaL_pushresult (B:Byte Ptr)

描述: 請參閱 Lua 參考手冊

函式 luaL_ref:Int (lua_state:Byte Ptr, t:Int)

描述: 請參閱 Lua 參考手冊

LuaL_register

[編輯 | 編輯原始碼]

函式 luaL_register (lua_state:Byte Ptr, libname$z, l:lua_Reg Ptr)

描述: 請參閱 Lua 參考手冊

LuaL_typerror

[編輯 | 編輯原始碼]

函式 luaL_typerror:Int (lua_state:Byte Ptr, narg:Int, tname$z)

描述: 請參閱 Lua 參考手冊

LuaL_unref

[編輯 | 編輯原始碼]

函式 luaL_unref (lua_state:Byte Ptr, t:Int, ref:Int)

描述: 請參閱 Lua 參考手冊

LuaL_where

[編輯 | 編輯原始碼]

函式 luaL_where (lua_state:Byte Ptr, lvl:Int)

描述: 請參閱 Lua 參考手冊

LuaL_addchar

[編輯 | 編輯原始碼]

函式 luaL_addchar (B:Byte Ptr, c:String)

描述: 請參閱 Lua 參考手冊

LuaL_argcheck

[編輯 | 編輯原始碼]

函式 luaL_argcheck (lua_state:Byte Ptr, cond:Int, narg:Int, extramsg:String)

描述: 請參閱 Lua 參考手冊

LuaL_checkint

[編輯 | 編輯原始碼]

函式 luaL_checkint:Int (lua_state:Byte Ptr, narg:Int)

描述: 請參閱 Lua 參考手冊

LuaL_checklong

[編輯 | 編輯原始碼]

函式 luaL_checklong:Long (lua_state:Byte Ptr, narg:Int)

描述: 請參閱 Lua 參考手冊

LuaL_checkstring

[編輯 | 編輯原始碼]

函式 luaL_checkstring:String (lua_state:Byte Ptr, narg:Int)

描述: 請參閱 Lua 參考手冊

LuaL_dofile

[編輯 | 編輯原始碼]

函式 luaL_dofile:Int (lua_state:Byte Ptr, filename:String)

描述: 請參閱 Lua 參考手冊

LuaL_dostring

[編輯 | 編輯原始碼]

函式 luaL_dostring:Int (lua_state:Byte Ptr, str:String)

描述: 請參閱 Lua 參考手冊

LuaL_getmetatable

[編輯 | 編輯原始碼]

函式 luaL_getmetatable (lua_state:Byte Ptr, tname:String)

描述: 請參閱 Lua 參考手冊

LuaL_optint

[編輯 | 編輯原始碼]

函式 luaL_optint:Int (lua_state:Byte Ptr, narg:Int, d:Int)

描述: 請參閱 Lua 參考手冊

LuaL_optlong

[編輯 | 編輯原始碼]

函式 luaL_optlong:Long (lua_state:Byte Ptr, narg:Int, d:Long)

描述: 請參閱 Lua 參考手冊

LuaL_optstring

[編輯 | 編輯原始碼]

函式 luaL_optstring:String (lua_state:Byte Ptr, narg:Int, d:String)

描述: 請參閱 Lua 參考手冊

LuaL_typename

[編輯 | 編輯原始碼]

函式 luaL_typename:String (lua_state:Byte Ptr, idx:Int)

描述: 請參閱 Lua 參考手冊

華夏公益教科書